Line data Source code
1 : /* Generated by Cython 3.0.11 */
2 :
3 : #ifndef PY_SSIZE_T_CLEAN
4 : #define PY_SSIZE_T_CLEAN
5 : #endif /* PY_SSIZE_T_CLEAN */
6 : #if defined(CYTHON_LIMITED_API) && 0
7 : #ifndef Py_LIMITED_API
8 : #if CYTHON_LIMITED_API+0 > 0x03030000
9 : #define Py_LIMITED_API CYTHON_LIMITED_API
10 : #else
11 : #define Py_LIMITED_API 0x03030000
12 : #endif
13 : #endif
14 : #endif
15 :
16 : #include "Python.h"
17 : #ifndef Py_PYTHON_H
18 : #error Python headers needed to compile C extensions, please install development version of Python.
19 : #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 : #error Cython requires Python 2.7+ or Python 3.3+.
21 : #else
22 : #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23 : #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
24 : #else
25 : #define __PYX_EXTRA_ABI_MODULE_NAME ""
26 : #endif
27 : #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28 : #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29 : #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30 : #define CYTHON_HEX_VERSION 0x03000BF0
31 : #define CYTHON_FUTURE_DIVISION 1
32 : #include <stddef.h>
33 : #ifndef offsetof
34 : #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 : #endif
36 : #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
37 : #ifndef __stdcall
38 : #define __stdcall
39 : #endif
40 : #ifndef __cdecl
41 : #define __cdecl
42 : #endif
43 : #ifndef __fastcall
44 : #define __fastcall
45 : #endif
46 : #endif
47 : #ifndef DL_IMPORT
48 : #define DL_IMPORT(t) t
49 : #endif
50 : #ifndef DL_EXPORT
51 : #define DL_EXPORT(t) t
52 : #endif
53 : #define __PYX_COMMA ,
54 : #ifndef HAVE_LONG_LONG
55 : #define HAVE_LONG_LONG
56 : #endif
57 : #ifndef PY_LONG_LONG
58 : #define PY_LONG_LONG LONG_LONG
59 : #endif
60 : #ifndef Py_HUGE_VAL
61 : #define Py_HUGE_VAL HUGE_VAL
62 : #endif
63 : #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64 : #if defined(GRAALVM_PYTHON)
65 : /* For very preliminary testing purposes. Most variables are set the same as PyPy.
66 : The existence of this section does not imply that anything works or is even tested */
67 : #define CYTHON_COMPILING_IN_PYPY 0
68 : #define CYTHON_COMPILING_IN_CPYTHON 0
69 : #define CYTHON_COMPILING_IN_LIMITED_API 0
70 : #define CYTHON_COMPILING_IN_GRAAL 1
71 : #define CYTHON_COMPILING_IN_NOGIL 0
72 : #undef CYTHON_USE_TYPE_SLOTS
73 : #define CYTHON_USE_TYPE_SLOTS 0
74 : #undef CYTHON_USE_TYPE_SPECS
75 : #define CYTHON_USE_TYPE_SPECS 0
76 : #undef CYTHON_USE_PYTYPE_LOOKUP
77 : #define CYTHON_USE_PYTYPE_LOOKUP 0
78 : #if PY_VERSION_HEX < 0x03050000
79 : #undef CYTHON_USE_ASYNC_SLOTS
80 : #define CYTHON_USE_ASYNC_SLOTS 0
81 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 : #define CYTHON_USE_ASYNC_SLOTS 1
83 : #endif
84 : #undef CYTHON_USE_PYLIST_INTERNALS
85 : #define CYTHON_USE_PYLIST_INTERNALS 0
86 : #undef CYTHON_USE_UNICODE_INTERNALS
87 : #define CYTHON_USE_UNICODE_INTERNALS 0
88 : #undef CYTHON_USE_UNICODE_WRITER
89 : #define CYTHON_USE_UNICODE_WRITER 0
90 : #undef CYTHON_USE_PYLONG_INTERNALS
91 : #define CYTHON_USE_PYLONG_INTERNALS 0
92 : #undef CYTHON_AVOID_BORROWED_REFS
93 : #define CYTHON_AVOID_BORROWED_REFS 1
94 : #undef CYTHON_ASSUME_SAFE_MACROS
95 : #define CYTHON_ASSUME_SAFE_MACROS 0
96 : #undef CYTHON_UNPACK_METHODS
97 : #define CYTHON_UNPACK_METHODS 0
98 : #undef CYTHON_FAST_THREAD_STATE
99 : #define CYTHON_FAST_THREAD_STATE 0
100 : #undef CYTHON_FAST_GIL
101 : #define CYTHON_FAST_GIL 0
102 : #undef CYTHON_METH_FASTCALL
103 : #define CYTHON_METH_FASTCALL 0
104 : #undef CYTHON_FAST_PYCALL
105 : #define CYTHON_FAST_PYCALL 0
106 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
108 : #endif
109 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 : #undef CYTHON_USE_MODULE_STATE
112 : #define CYTHON_USE_MODULE_STATE 0
113 : #undef CYTHON_USE_TP_FINALIZE
114 : #define CYTHON_USE_TP_FINALIZE 0
115 : #undef CYTHON_USE_DICT_VERSIONS
116 : #define CYTHON_USE_DICT_VERSIONS 0
117 : #undef CYTHON_USE_EXC_INFO_STACK
118 : #define CYTHON_USE_EXC_INFO_STACK 0
119 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
121 : #endif
122 : #undef CYTHON_USE_FREELISTS
123 : #define CYTHON_USE_FREELISTS 0
124 : #elif defined(PYPY_VERSION)
125 : #define CYTHON_COMPILING_IN_PYPY 1
126 : #define CYTHON_COMPILING_IN_CPYTHON 0
127 : #define CYTHON_COMPILING_IN_LIMITED_API 0
128 : #define CYTHON_COMPILING_IN_GRAAL 0
129 : #define CYTHON_COMPILING_IN_NOGIL 0
130 : #undef CYTHON_USE_TYPE_SLOTS
131 : #define CYTHON_USE_TYPE_SLOTS 0
132 : #ifndef CYTHON_USE_TYPE_SPECS
133 : #define CYTHON_USE_TYPE_SPECS 0
134 : #endif
135 : #undef CYTHON_USE_PYTYPE_LOOKUP
136 : #define CYTHON_USE_PYTYPE_LOOKUP 0
137 : #if PY_VERSION_HEX < 0x03050000
138 : #undef CYTHON_USE_ASYNC_SLOTS
139 : #define CYTHON_USE_ASYNC_SLOTS 0
140 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 : #define CYTHON_USE_ASYNC_SLOTS 1
142 : #endif
143 : #undef CYTHON_USE_PYLIST_INTERNALS
144 : #define CYTHON_USE_PYLIST_INTERNALS 0
145 : #undef CYTHON_USE_UNICODE_INTERNALS
146 : #define CYTHON_USE_UNICODE_INTERNALS 0
147 : #undef CYTHON_USE_UNICODE_WRITER
148 : #define CYTHON_USE_UNICODE_WRITER 0
149 : #undef CYTHON_USE_PYLONG_INTERNALS
150 : #define CYTHON_USE_PYLONG_INTERNALS 0
151 : #undef CYTHON_AVOID_BORROWED_REFS
152 : #define CYTHON_AVOID_BORROWED_REFS 1
153 : #undef CYTHON_ASSUME_SAFE_MACROS
154 : #define CYTHON_ASSUME_SAFE_MACROS 0
155 : #undef CYTHON_UNPACK_METHODS
156 : #define CYTHON_UNPACK_METHODS 0
157 : #undef CYTHON_FAST_THREAD_STATE
158 : #define CYTHON_FAST_THREAD_STATE 0
159 : #undef CYTHON_FAST_GIL
160 : #define CYTHON_FAST_GIL 0
161 : #undef CYTHON_METH_FASTCALL
162 : #define CYTHON_METH_FASTCALL 0
163 : #undef CYTHON_FAST_PYCALL
164 : #define CYTHON_FAST_PYCALL 0
165 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
167 : #endif
168 : #if PY_VERSION_HEX < 0x03090000
169 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
173 : #endif
174 : #undef CYTHON_USE_MODULE_STATE
175 : #define CYTHON_USE_MODULE_STATE 0
176 : #undef CYTHON_USE_TP_FINALIZE
177 : #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 : #undef CYTHON_USE_DICT_VERSIONS
179 : #define CYTHON_USE_DICT_VERSIONS 0
180 : #undef CYTHON_USE_EXC_INFO_STACK
181 : #define CYTHON_USE_EXC_INFO_STACK 0
182 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
184 : #endif
185 : #undef CYTHON_USE_FREELISTS
186 : #define CYTHON_USE_FREELISTS 0
187 : #elif defined(CYTHON_LIMITED_API)
188 : #ifdef Py_LIMITED_API
189 : #undef __PYX_LIMITED_VERSION_HEX
190 : #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
191 : #endif
192 : #define CYTHON_COMPILING_IN_PYPY 0
193 : #define CYTHON_COMPILING_IN_CPYTHON 0
194 : #define CYTHON_COMPILING_IN_LIMITED_API 1
195 : #define CYTHON_COMPILING_IN_GRAAL 0
196 : #define CYTHON_COMPILING_IN_NOGIL 0
197 : #undef CYTHON_CLINE_IN_TRACEBACK
198 : #define CYTHON_CLINE_IN_TRACEBACK 0
199 : #undef CYTHON_USE_TYPE_SLOTS
200 : #define CYTHON_USE_TYPE_SLOTS 0
201 : #undef CYTHON_USE_TYPE_SPECS
202 : #define CYTHON_USE_TYPE_SPECS 1
203 : #undef CYTHON_USE_PYTYPE_LOOKUP
204 : #define CYTHON_USE_PYTYPE_LOOKUP 0
205 : #undef CYTHON_USE_ASYNC_SLOTS
206 : #define CYTHON_USE_ASYNC_SLOTS 0
207 : #undef CYTHON_USE_PYLIST_INTERNALS
208 : #define CYTHON_USE_PYLIST_INTERNALS 0
209 : #undef CYTHON_USE_UNICODE_INTERNALS
210 : #define CYTHON_USE_UNICODE_INTERNALS 0
211 : #ifndef CYTHON_USE_UNICODE_WRITER
212 : #define CYTHON_USE_UNICODE_WRITER 0
213 : #endif
214 : #undef CYTHON_USE_PYLONG_INTERNALS
215 : #define CYTHON_USE_PYLONG_INTERNALS 0
216 : #ifndef CYTHON_AVOID_BORROWED_REFS
217 : #define CYTHON_AVOID_BORROWED_REFS 0
218 : #endif
219 : #undef CYTHON_ASSUME_SAFE_MACROS
220 : #define CYTHON_ASSUME_SAFE_MACROS 0
221 : #undef CYTHON_UNPACK_METHODS
222 : #define CYTHON_UNPACK_METHODS 0
223 : #undef CYTHON_FAST_THREAD_STATE
224 : #define CYTHON_FAST_THREAD_STATE 0
225 : #undef CYTHON_FAST_GIL
226 : #define CYTHON_FAST_GIL 0
227 : #undef CYTHON_METH_FASTCALL
228 : #define CYTHON_METH_FASTCALL 0
229 : #undef CYTHON_FAST_PYCALL
230 : #define CYTHON_FAST_PYCALL 0
231 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 : #define CYTHON_PEP487_INIT_SUBCLASS 1
233 : #endif
234 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 : #undef CYTHON_USE_MODULE_STATE
237 : #define CYTHON_USE_MODULE_STATE 1
238 : #ifndef CYTHON_USE_TP_FINALIZE
239 : #define CYTHON_USE_TP_FINALIZE 0
240 : #endif
241 : #undef CYTHON_USE_DICT_VERSIONS
242 : #define CYTHON_USE_DICT_VERSIONS 0
243 : #undef CYTHON_USE_EXC_INFO_STACK
244 : #define CYTHON_USE_EXC_INFO_STACK 0
245 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
247 : #endif
248 : #undef CYTHON_USE_FREELISTS
249 : #define CYTHON_USE_FREELISTS 0
250 : #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 : #define CYTHON_COMPILING_IN_PYPY 0
252 : #define CYTHON_COMPILING_IN_CPYTHON 0
253 : #define CYTHON_COMPILING_IN_LIMITED_API 0
254 : #define CYTHON_COMPILING_IN_GRAAL 0
255 : #define CYTHON_COMPILING_IN_NOGIL 1
256 : #ifndef CYTHON_USE_TYPE_SLOTS
257 : #define CYTHON_USE_TYPE_SLOTS 1
258 : #endif
259 : #ifndef CYTHON_USE_TYPE_SPECS
260 : #define CYTHON_USE_TYPE_SPECS 0
261 : #endif
262 : #undef CYTHON_USE_PYTYPE_LOOKUP
263 : #define CYTHON_USE_PYTYPE_LOOKUP 0
264 : #ifndef CYTHON_USE_ASYNC_SLOTS
265 : #define CYTHON_USE_ASYNC_SLOTS 1
266 : #endif
267 : #ifndef CYTHON_USE_PYLONG_INTERNALS
268 : #define CYTHON_USE_PYLONG_INTERNALS 0
269 : #endif
270 : #undef CYTHON_USE_PYLIST_INTERNALS
271 : #define CYTHON_USE_PYLIST_INTERNALS 0
272 : #ifndef CYTHON_USE_UNICODE_INTERNALS
273 : #define CYTHON_USE_UNICODE_INTERNALS 1
274 : #endif
275 : #undef CYTHON_USE_UNICODE_WRITER
276 : #define CYTHON_USE_UNICODE_WRITER 0
277 : #ifndef CYTHON_AVOID_BORROWED_REFS
278 : #define CYTHON_AVOID_BORROWED_REFS 0
279 : #endif
280 : #ifndef CYTHON_ASSUME_SAFE_MACROS
281 : #define CYTHON_ASSUME_SAFE_MACROS 1
282 : #endif
283 : #ifndef CYTHON_UNPACK_METHODS
284 : #define CYTHON_UNPACK_METHODS 1
285 : #endif
286 : #undef CYTHON_FAST_THREAD_STATE
287 : #define CYTHON_FAST_THREAD_STATE 0
288 : #undef CYTHON_FAST_GIL
289 : #define CYTHON_FAST_GIL 0
290 : #ifndef CYTHON_METH_FASTCALL
291 : #define CYTHON_METH_FASTCALL 1
292 : #endif
293 : #undef CYTHON_FAST_PYCALL
294 : #define CYTHON_FAST_PYCALL 0
295 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 : #define CYTHON_PEP487_INIT_SUBCLASS 1
297 : #endif
298 : #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
300 : #endif
301 : #ifndef CYTHON_USE_MODULE_STATE
302 : #define CYTHON_USE_MODULE_STATE 0
303 : #endif
304 : #ifndef CYTHON_USE_TP_FINALIZE
305 : #define CYTHON_USE_TP_FINALIZE 1
306 : #endif
307 : #undef CYTHON_USE_DICT_VERSIONS
308 : #define CYTHON_USE_DICT_VERSIONS 0
309 : #undef CYTHON_USE_EXC_INFO_STACK
310 : #define CYTHON_USE_EXC_INFO_STACK 0
311 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
313 : #endif
314 : #ifndef CYTHON_USE_FREELISTS
315 : #define CYTHON_USE_FREELISTS 0
316 : #endif
317 : #else
318 : #define CYTHON_COMPILING_IN_PYPY 0
319 : #define CYTHON_COMPILING_IN_CPYTHON 1
320 : #define CYTHON_COMPILING_IN_LIMITED_API 0
321 : #define CYTHON_COMPILING_IN_GRAAL 0
322 : #define CYTHON_COMPILING_IN_NOGIL 0
323 : #ifndef CYTHON_USE_TYPE_SLOTS
324 : #define CYTHON_USE_TYPE_SLOTS 1
325 : #endif
326 : #ifndef CYTHON_USE_TYPE_SPECS
327 : #define CYTHON_USE_TYPE_SPECS 0
328 : #endif
329 : #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 : #define CYTHON_USE_PYTYPE_LOOKUP 1
331 : #endif
332 : #if PY_MAJOR_VERSION < 3
333 : #undef CYTHON_USE_ASYNC_SLOTS
334 : #define CYTHON_USE_ASYNC_SLOTS 0
335 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 : #define CYTHON_USE_ASYNC_SLOTS 1
337 : #endif
338 : #ifndef CYTHON_USE_PYLONG_INTERNALS
339 : #define CYTHON_USE_PYLONG_INTERNALS 1
340 : #endif
341 : #ifndef CYTHON_USE_PYLIST_INTERNALS
342 : #define CYTHON_USE_PYLIST_INTERNALS 1
343 : #endif
344 : #ifndef CYTHON_USE_UNICODE_INTERNALS
345 : #define CYTHON_USE_UNICODE_INTERNALS 1
346 : #endif
347 : #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 : #undef CYTHON_USE_UNICODE_WRITER
349 : #define CYTHON_USE_UNICODE_WRITER 0
350 : #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 : #define CYTHON_USE_UNICODE_WRITER 1
352 : #endif
353 : #ifndef CYTHON_AVOID_BORROWED_REFS
354 : #define CYTHON_AVOID_BORROWED_REFS 0
355 : #endif
356 : #ifndef CYTHON_ASSUME_SAFE_MACROS
357 : #define CYTHON_ASSUME_SAFE_MACROS 1
358 : #endif
359 : #ifndef CYTHON_UNPACK_METHODS
360 : #define CYTHON_UNPACK_METHODS 1
361 : #endif
362 : #ifndef CYTHON_FAST_THREAD_STATE
363 : #define CYTHON_FAST_THREAD_STATE 1
364 : #endif
365 : #ifndef CYTHON_FAST_GIL
366 : #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
367 : #endif
368 : #ifndef CYTHON_METH_FASTCALL
369 : #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
370 : #endif
371 : #ifndef CYTHON_FAST_PYCALL
372 : #define CYTHON_FAST_PYCALL 1
373 : #endif
374 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 : #define CYTHON_PEP487_INIT_SUBCLASS 1
376 : #endif
377 : #if PY_VERSION_HEX < 0x03050000
378 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 : #endif
383 : #ifndef CYTHON_USE_MODULE_STATE
384 : #define CYTHON_USE_MODULE_STATE 0
385 : #endif
386 : #if PY_VERSION_HEX < 0x030400a1
387 : #undef CYTHON_USE_TP_FINALIZE
388 : #define CYTHON_USE_TP_FINALIZE 0
389 : #elif !defined(CYTHON_USE_TP_FINALIZE)
390 : #define CYTHON_USE_TP_FINALIZE 1
391 : #endif
392 : #if PY_VERSION_HEX < 0x030600B1
393 : #undef CYTHON_USE_DICT_VERSIONS
394 : #define CYTHON_USE_DICT_VERSIONS 0
395 : #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 : #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
397 : #endif
398 : #if PY_VERSION_HEX < 0x030700A3
399 : #undef CYTHON_USE_EXC_INFO_STACK
400 : #define CYTHON_USE_EXC_INFO_STACK 0
401 : #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 : #define CYTHON_USE_EXC_INFO_STACK 1
403 : #endif
404 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
406 : #endif
407 : #ifndef CYTHON_USE_FREELISTS
408 : #define CYTHON_USE_FREELISTS 1
409 : #endif
410 : #endif
411 : #if !defined(CYTHON_FAST_PYCCALL)
412 : #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
413 : #endif
414 : #if !defined(CYTHON_VECTORCALL)
415 : #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
416 : #endif
417 : #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418 : #if CYTHON_USE_PYLONG_INTERNALS
419 : #if PY_MAJOR_VERSION < 3
420 : #include "longintrepr.h"
421 : #endif
422 : #undef SHIFT
423 : #undef BASE
424 : #undef MASK
425 : #ifdef SIZEOF_VOID_P
426 : enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
427 : #endif
428 : #endif
429 : #ifndef __has_attribute
430 : #define __has_attribute(x) 0
431 : #endif
432 : #ifndef __has_cpp_attribute
433 : #define __has_cpp_attribute(x) 0
434 : #endif
435 : #ifndef CYTHON_RESTRICT
436 : #if defined(__GNUC__)
437 : #define CYTHON_RESTRICT __restrict__
438 : #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 : #define CYTHON_RESTRICT __restrict
440 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 : #define CYTHON_RESTRICT restrict
442 : #else
443 : #define CYTHON_RESTRICT
444 : #endif
445 : #endif
446 : #ifndef CYTHON_UNUSED
447 : #if defined(__cplusplus)
448 : /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
449 : * but leads to warnings with -pedantic, since it is a C++17 feature */
450 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 : #if __has_cpp_attribute(maybe_unused)
452 : #define CYTHON_UNUSED [[maybe_unused]]
453 : #endif
454 : #endif
455 : #endif
456 : #endif
457 : #ifndef CYTHON_UNUSED
458 : # if defined(__GNUC__)
459 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460 : # define CYTHON_UNUSED __attribute__ ((__unused__))
461 : # else
462 : # define CYTHON_UNUSED
463 : # endif
464 : # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465 : # define CYTHON_UNUSED __attribute__ ((__unused__))
466 : # else
467 : # define CYTHON_UNUSED
468 : # endif
469 : #endif
470 : #ifndef CYTHON_UNUSED_VAR
471 : # if defined(__cplusplus)
472 : template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
473 : # else
474 : # define CYTHON_UNUSED_VAR(x) (void)(x)
475 : # endif
476 : #endif
477 : #ifndef CYTHON_MAYBE_UNUSED_VAR
478 : #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
479 : #endif
480 : #ifndef CYTHON_NCP_UNUSED
481 : # if CYTHON_COMPILING_IN_CPYTHON
482 : # define CYTHON_NCP_UNUSED
483 : # else
484 : # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 : # endif
486 : #endif
487 : #ifndef CYTHON_USE_CPP_STD_MOVE
488 : #if defined(__cplusplus) && (\
489 : __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 : #define CYTHON_USE_CPP_STD_MOVE 1
491 : #else
492 : #define CYTHON_USE_CPP_STD_MOVE 0
493 : #endif
494 : #endif
495 : #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
496 : #ifdef _MSC_VER
497 : #ifndef _MSC_STDINT_H_
498 : #if _MSC_VER < 1300
499 : typedef unsigned char uint8_t;
500 : typedef unsigned short uint16_t;
501 : typedef unsigned int uint32_t;
502 : #else
503 : typedef unsigned __int8 uint8_t;
504 : typedef unsigned __int16 uint16_t;
505 : typedef unsigned __int32 uint32_t;
506 : #endif
507 : #endif
508 : #if _MSC_VER < 1300
509 : #ifdef _WIN64
510 : typedef unsigned long long __pyx_uintptr_t;
511 : #else
512 : typedef unsigned int __pyx_uintptr_t;
513 : #endif
514 : #else
515 : #ifdef _WIN64
516 : typedef unsigned __int64 __pyx_uintptr_t;
517 : #else
518 : typedef unsigned __int32 __pyx_uintptr_t;
519 : #endif
520 : #endif
521 : #else
522 : #include <stdint.h>
523 : typedef uintptr_t __pyx_uintptr_t;
524 : #endif
525 : #ifndef CYTHON_FALLTHROUGH
526 : #if defined(__cplusplus)
527 : /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
528 : * but leads to warnings with -pedantic, since it is a C++17 feature */
529 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 : #if __has_cpp_attribute(fallthrough)
531 : #define CYTHON_FALLTHROUGH [[fallthrough]]
532 : #endif
533 : #endif
534 : #ifndef CYTHON_FALLTHROUGH
535 : #if __has_cpp_attribute(clang::fallthrough)
536 : #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 : #elif __has_cpp_attribute(gnu::fallthrough)
538 : #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
539 : #endif
540 : #endif
541 : #endif
542 : #ifndef CYTHON_FALLTHROUGH
543 : #if __has_attribute(fallthrough)
544 : #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
545 : #else
546 : #define CYTHON_FALLTHROUGH
547 : #endif
548 : #endif
549 : #if defined(__clang__) && defined(__apple_build_version__)
550 : #if __apple_build_version__ < 7000000
551 : #undef CYTHON_FALLTHROUGH
552 : #define CYTHON_FALLTHROUGH
553 : #endif
554 : #endif
555 : #endif
556 : #ifdef __cplusplus
557 : template <typename T>
558 : struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
559 : #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
560 : #else
561 : #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
562 : #endif
563 : #if CYTHON_COMPILING_IN_PYPY == 1
564 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
565 : #else
566 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
567 : #endif
568 : #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
569 :
570 : #ifndef __cplusplus
571 : #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
572 : #endif
573 : #ifndef CYTHON_INLINE
574 : #if defined(__clang__)
575 : #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
576 : #else
577 : #define CYTHON_INLINE inline
578 : #endif
579 : #endif
580 : template<typename T>
581 2484 : void __Pyx_call_destructor(T& x) {
582 2484 : x.~T();
583 : }
584 : template<typename T>
585 : class __Pyx_FakeReference {
586 : public:
587 : __Pyx_FakeReference() : ptr(NULL) { }
588 : __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
589 : T *operator->() { return ptr; }
590 : T *operator&() { return ptr; }
591 : operator T&() { return *ptr; }
592 : template<typename U> bool operator ==(const U& other) const { return *ptr == other; }
593 : template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
594 : template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
595 : template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
596 : private:
597 : T *ptr;
598 : };
599 :
600 : #define __PYX_BUILD_PY_SSIZE_T "n"
601 : #define CYTHON_FORMAT_SSIZE_T "z"
602 : #if PY_MAJOR_VERSION < 3
603 : #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
604 : #define __Pyx_DefaultClassType PyClass_Type
605 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
606 : PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
607 : #else
608 : #define __Pyx_BUILTIN_MODULE_NAME "builtins"
609 : #define __Pyx_DefaultClassType PyType_Type
610 : #if CYTHON_COMPILING_IN_LIMITED_API
611 : static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
612 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
613 : PyObject *fv, PyObject *cell, PyObject* fn,
614 : PyObject *name, int fline, PyObject *lnos) {
615 : PyObject *exception_table = NULL;
616 : PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
617 : #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
618 : PyObject *version_info;
619 : PyObject *py_minor_version = NULL;
620 : #endif
621 : long minor_version = 0;
622 : PyObject *type, *value, *traceback;
623 : PyErr_Fetch(&type, &value, &traceback);
624 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
625 : minor_version = 11;
626 : #else
627 : if (!(version_info = PySys_GetObject("version_info"))) goto end;
628 : if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
629 : minor_version = PyLong_AsLong(py_minor_version);
630 : Py_DECREF(py_minor_version);
631 : if (minor_version == -1 && PyErr_Occurred()) goto end;
632 : #endif
633 : if (!(types_module = PyImport_ImportModule("types"))) goto end;
634 : if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
635 : if (minor_version <= 7) {
636 : (void)p;
637 : result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
638 : c, n, v, fn, name, fline, lnos, fv, cell);
639 : } else if (minor_version <= 10) {
640 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
641 : c, n, v, fn, name, fline, lnos, fv, cell);
642 : } else {
643 : if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
644 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
645 : c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
646 : }
647 : end:
648 : Py_XDECREF(code_type);
649 : Py_XDECREF(exception_table);
650 : Py_XDECREF(types_module);
651 : if (type) {
652 : PyErr_Restore(type, value, traceback);
653 : }
654 : return result;
655 : }
656 : #ifndef CO_OPTIMIZED
657 : #define CO_OPTIMIZED 0x0001
658 : #endif
659 : #ifndef CO_NEWLOCALS
660 : #define CO_NEWLOCALS 0x0002
661 : #endif
662 : #ifndef CO_VARARGS
663 : #define CO_VARARGS 0x0004
664 : #endif
665 : #ifndef CO_VARKEYWORDS
666 : #define CO_VARKEYWORDS 0x0008
667 : #endif
668 : #ifndef CO_ASYNC_GENERATOR
669 : #define CO_ASYNC_GENERATOR 0x0200
670 : #endif
671 : #ifndef CO_GENERATOR
672 : #define CO_GENERATOR 0x0020
673 : #endif
674 : #ifndef CO_COROUTINE
675 : #define CO_COROUTINE 0x0080
676 : #endif
677 : #elif PY_VERSION_HEX >= 0x030B0000
678 39 : static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
679 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
680 : PyObject *fv, PyObject *cell, PyObject* fn,
681 : PyObject *name, int fline, PyObject *lnos) {
682 39 : PyCodeObject *result;
683 39 : PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
684 39 : if (!empty_bytes) return NULL;
685 39 : result =
686 : #if PY_VERSION_HEX >= 0x030C0000
687 : PyUnstable_Code_NewWithPosOnlyArgs
688 : #else
689 : PyCode_NewWithPosOnlyArgs
690 : #endif
691 39 : (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
692 39 : Py_DECREF(empty_bytes);
693 : return result;
694 : }
695 : #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
696 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
697 : PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
698 : #else
699 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
700 : PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
701 : #endif
702 : #endif
703 : #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
704 : #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
705 : #else
706 : #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
707 : #endif
708 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
709 : #define __Pyx_Py_Is(x, y) Py_Is(x, y)
710 : #else
711 : #define __Pyx_Py_Is(x, y) ((x) == (y))
712 : #endif
713 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
714 : #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
715 : #else
716 : #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
717 : #endif
718 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
719 : #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
720 : #else
721 : #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
722 : #endif
723 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
724 : #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
725 : #else
726 : #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
727 : #endif
728 : #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
729 : #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
730 : #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
731 : #else
732 : #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
733 : #endif
734 : #ifndef CO_COROUTINE
735 : #define CO_COROUTINE 0x80
736 : #endif
737 : #ifndef CO_ASYNC_GENERATOR
738 : #define CO_ASYNC_GENERATOR 0x200
739 : #endif
740 : #ifndef Py_TPFLAGS_CHECKTYPES
741 : #define Py_TPFLAGS_CHECKTYPES 0
742 : #endif
743 : #ifndef Py_TPFLAGS_HAVE_INDEX
744 : #define Py_TPFLAGS_HAVE_INDEX 0
745 : #endif
746 : #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
747 : #define Py_TPFLAGS_HAVE_NEWBUFFER 0
748 : #endif
749 : #ifndef Py_TPFLAGS_HAVE_FINALIZE
750 : #define Py_TPFLAGS_HAVE_FINALIZE 0
751 : #endif
752 : #ifndef Py_TPFLAGS_SEQUENCE
753 : #define Py_TPFLAGS_SEQUENCE 0
754 : #endif
755 : #ifndef Py_TPFLAGS_MAPPING
756 : #define Py_TPFLAGS_MAPPING 0
757 : #endif
758 : #ifndef METH_STACKLESS
759 : #define METH_STACKLESS 0
760 : #endif
761 : #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
762 : #ifndef METH_FASTCALL
763 : #define METH_FASTCALL 0x80
764 : #endif
765 : typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
766 : typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
767 : Py_ssize_t nargs, PyObject *kwnames);
768 : #else
769 : #if PY_VERSION_HEX >= 0x030d00A4
770 : # define __Pyx_PyCFunctionFast PyCFunctionFast
771 : # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
772 : #else
773 : # define __Pyx_PyCFunctionFast _PyCFunctionFast
774 : # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
775 : #endif
776 : #endif
777 : #if CYTHON_METH_FASTCALL
778 : #define __Pyx_METH_FASTCALL METH_FASTCALL
779 : #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
780 : #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
781 : #else
782 : #define __Pyx_METH_FASTCALL METH_VARARGS
783 : #define __Pyx_PyCFunction_FastCall PyCFunction
784 : #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
785 : #endif
786 : #if CYTHON_VECTORCALL
787 : #define __pyx_vectorcallfunc vectorcallfunc
788 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
789 : #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
790 : #elif CYTHON_BACKPORT_VECTORCALL
791 : typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
792 : size_t nargsf, PyObject *kwnames);
793 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
794 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
795 : #else
796 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
797 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
798 : #endif
799 : #if PY_MAJOR_VERSION >= 0x030900B1
800 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
801 : #else
802 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
803 : #endif
804 : #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
805 : #if CYTHON_COMPILING_IN_CPYTHON
806 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
807 : #elif !CYTHON_COMPILING_IN_LIMITED_API
808 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
809 : #endif
810 : #if CYTHON_COMPILING_IN_CPYTHON
811 : #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
812 0 : static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
813 0 : return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
814 : }
815 : #endif
816 : static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
817 : #if CYTHON_COMPILING_IN_LIMITED_API
818 : return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
819 : #else
820 : return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
821 : #endif
822 : }
823 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
824 : #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
825 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
826 : typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
827 : #else
828 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
829 : #define __Pyx_PyCMethod PyCMethod
830 : #endif
831 : #ifndef METH_METHOD
832 : #define METH_METHOD 0x200
833 : #endif
834 : #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
835 : #define PyObject_Malloc(s) PyMem_Malloc(s)
836 : #define PyObject_Free(p) PyMem_Free(p)
837 : #define PyObject_Realloc(p) PyMem_Realloc(p)
838 : #endif
839 : #if CYTHON_COMPILING_IN_LIMITED_API
840 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
841 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
842 : #else
843 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
844 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
845 : #endif
846 : #if CYTHON_COMPILING_IN_LIMITED_API
847 : #define __Pyx_PyThreadState_Current PyThreadState_Get()
848 : #elif !CYTHON_FAST_THREAD_STATE
849 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
850 : #elif PY_VERSION_HEX >= 0x030d00A1
851 : #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
852 : #elif PY_VERSION_HEX >= 0x03060000
853 : #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
854 : #elif PY_VERSION_HEX >= 0x03000000
855 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
856 : #else
857 : #define __Pyx_PyThreadState_Current _PyThreadState_Current
858 : #endif
859 : #if CYTHON_COMPILING_IN_LIMITED_API
860 : static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
861 : {
862 : void *result;
863 : result = PyModule_GetState(op);
864 : if (!result)
865 : Py_FatalError("Couldn't find the module state");
866 : return result;
867 : }
868 : #endif
869 : #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
870 : #if CYTHON_COMPILING_IN_LIMITED_API
871 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
872 : #else
873 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
874 : #endif
875 : #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
876 : #include "pythread.h"
877 : #define Py_tss_NEEDS_INIT 0
878 : typedef int Py_tss_t;
879 : static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
880 : *key = PyThread_create_key();
881 : return 0;
882 : }
883 : static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
884 : Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
885 : *key = Py_tss_NEEDS_INIT;
886 : return key;
887 : }
888 : static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
889 : PyObject_Free(key);
890 : }
891 : static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
892 : return *key != Py_tss_NEEDS_INIT;
893 : }
894 : static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
895 : PyThread_delete_key(*key);
896 : *key = Py_tss_NEEDS_INIT;
897 : }
898 : static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
899 : return PyThread_set_key_value(*key, value);
900 : }
901 : static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
902 : return PyThread_get_key_value(*key);
903 : }
904 : #endif
905 : #if PY_MAJOR_VERSION < 3
906 : #if CYTHON_COMPILING_IN_PYPY
907 : #if PYPY_VERSION_NUM < 0x07030600
908 : #if defined(__cplusplus) && __cplusplus >= 201402L
909 : [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
910 : #elif defined(__GNUC__) || defined(__clang__)
911 : __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
912 : #elif defined(_MSC_VER)
913 : __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
914 : #endif
915 : static CYTHON_INLINE int PyGILState_Check(void) {
916 : return 0;
917 : }
918 : #else // PYPY_VERSION_NUM < 0x07030600
919 : #endif // PYPY_VERSION_NUM < 0x07030600
920 : #else
921 : static CYTHON_INLINE int PyGILState_Check(void) {
922 : PyThreadState * tstate = _PyThreadState_Current;
923 : return tstate && (tstate == PyGILState_GetThisThreadState());
924 : }
925 : #endif
926 : #endif
927 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
928 : #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
929 : #else
930 : #define __Pyx_PyDict_NewPresized(n) PyDict_New()
931 : #endif
932 : #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
933 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
934 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
935 : #else
936 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
937 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
938 : #endif
939 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
940 : #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
941 2080 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
942 2080 : PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
943 2080 : if (res == NULL) PyErr_Clear();
944 2080 : return res;
945 : }
946 : #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
947 : #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
948 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
949 : #else
950 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
951 : #if CYTHON_COMPILING_IN_PYPY
952 : return PyDict_GetItem(dict, name);
953 : #else
954 : PyDictEntry *ep;
955 : PyDictObject *mp = (PyDictObject*) dict;
956 : long hash = ((PyStringObject *) name)->ob_shash;
957 : assert(hash != -1);
958 : ep = (mp->ma_lookup)(mp, name, hash);
959 : if (ep == NULL) {
960 : return NULL;
961 : }
962 : return ep->me_value;
963 : #endif
964 : }
965 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
966 : #endif
967 : #if CYTHON_USE_TYPE_SLOTS
968 : #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
969 : #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
970 : #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
971 : #else
972 : #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
973 : #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
974 : #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
975 : #endif
976 : #if CYTHON_COMPILING_IN_LIMITED_API
977 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
978 : #else
979 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
980 : #endif
981 : #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
982 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
983 : PyTypeObject *type = Py_TYPE((PyObject*)obj);\
984 : assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
985 : PyObject_GC_Del(obj);\
986 : Py_DECREF(type);\
987 : }
988 : #else
989 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
990 : #endif
991 : #if CYTHON_COMPILING_IN_LIMITED_API
992 : #define CYTHON_PEP393_ENABLED 1
993 : #define __Pyx_PyUnicode_READY(op) (0)
994 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
995 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
996 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
997 : #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
998 : #define __Pyx_PyUnicode_DATA(u) ((void*)u)
999 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
1000 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
1001 : #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
1002 : #define CYTHON_PEP393_ENABLED 1
1003 : #if PY_VERSION_HEX >= 0x030C0000
1004 : #define __Pyx_PyUnicode_READY(op) (0)
1005 : #else
1006 : #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
1007 : 0 : _PyUnicode_Ready((PyObject *)(op)))
1008 : #endif
1009 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
1010 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
1011 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
1012 : #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
1013 : #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
1014 : #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
1015 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1016 : #if PY_VERSION_HEX >= 0x030C0000
1017 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1018 : #else
1019 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1020 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1021 : #else
1022 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1023 : #endif
1024 : #endif
1025 : #else
1026 : #define CYTHON_PEP393_ENABLED 0
1027 : #define PyUnicode_1BYTE_KIND 1
1028 : #define PyUnicode_2BYTE_KIND 2
1029 : #define PyUnicode_4BYTE_KIND 4
1030 : #define __Pyx_PyUnicode_READY(op) (0)
1031 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1032 : #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1033 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1034 : #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1035 : #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1036 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1037 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1038 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1039 : #endif
1040 : #if CYTHON_COMPILING_IN_PYPY
1041 : #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1042 : #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1043 : #else
1044 : #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1045 : #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1046 : PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1047 : #endif
1048 : #if CYTHON_COMPILING_IN_PYPY
1049 : #if !defined(PyUnicode_DecodeUnicodeEscape)
1050 : #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1051 : #endif
1052 : #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1053 : #undef PyUnicode_Contains
1054 : #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1055 : #endif
1056 : #if !defined(PyByteArray_Check)
1057 : #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1058 : #endif
1059 : #if !defined(PyObject_Format)
1060 : #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1061 : #endif
1062 : #endif
1063 : #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1064 : #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1065 : #if PY_MAJOR_VERSION >= 3
1066 : #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1067 : #else
1068 : #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1069 : #endif
1070 : #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1071 : #define PyObject_ASCII(o) PyObject_Repr(o)
1072 : #endif
1073 : #if PY_MAJOR_VERSION >= 3
1074 : #define PyBaseString_Type PyUnicode_Type
1075 : #define PyStringObject PyUnicodeObject
1076 : #define PyString_Type PyUnicode_Type
1077 : #define PyString_Check PyUnicode_Check
1078 : #define PyString_CheckExact PyUnicode_CheckExact
1079 : #ifndef PyObject_Unicode
1080 : #define PyObject_Unicode PyObject_Str
1081 : #endif
1082 : #endif
1083 : #if PY_MAJOR_VERSION >= 3
1084 : #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1085 : #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1086 : #else
1087 : #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1088 : #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1089 : #endif
1090 : #if CYTHON_COMPILING_IN_CPYTHON
1091 : #define __Pyx_PySequence_ListKeepNew(obj)\
1092 : (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1093 : #else
1094 : #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1095 : #endif
1096 : #ifndef PySet_CheckExact
1097 : #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1098 : #endif
1099 : #if PY_VERSION_HEX >= 0x030900A4
1100 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1101 : #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1102 : #else
1103 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1104 : #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1105 : #endif
1106 : #if CYTHON_ASSUME_SAFE_MACROS
1107 : #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1108 : #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1109 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1110 : #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1111 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1112 : #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1113 : #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1114 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1115 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1116 : #else
1117 : #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1118 : #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1119 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1120 : #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1121 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1122 : #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1123 : #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1124 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1125 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1126 : #endif
1127 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1128 : #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1129 : #else
1130 12 : static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1131 12 : PyObject *module = PyImport_AddModule(name);
1132 12 : Py_XINCREF(module);
1133 12 : return module;
1134 : }
1135 : #endif
1136 : #if PY_MAJOR_VERSION >= 3
1137 : #define PyIntObject PyLongObject
1138 : #define PyInt_Type PyLong_Type
1139 : #define PyInt_Check(op) PyLong_Check(op)
1140 : #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1141 : #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1142 : #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1143 : #define PyInt_FromString PyLong_FromString
1144 : #define PyInt_FromUnicode PyLong_FromUnicode
1145 : #define PyInt_FromLong PyLong_FromLong
1146 : #define PyInt_FromSize_t PyLong_FromSize_t
1147 : #define PyInt_FromSsize_t PyLong_FromSsize_t
1148 : #define PyInt_AsLong PyLong_AsLong
1149 : #define PyInt_AS_LONG PyLong_AS_LONG
1150 : #define PyInt_AsSsize_t PyLong_AsSsize_t
1151 : #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1152 : #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1153 : #define PyNumber_Int PyNumber_Long
1154 : #else
1155 : #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1156 : #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1157 : #endif
1158 : #if PY_MAJOR_VERSION >= 3
1159 : #define PyBoolObject PyLongObject
1160 : #endif
1161 : #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1162 : #ifndef PyUnicode_InternFromString
1163 : #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1164 : #endif
1165 : #endif
1166 : #if PY_VERSION_HEX < 0x030200A4
1167 : typedef long Py_hash_t;
1168 : #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1169 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1170 : #else
1171 : #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1172 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1173 : #endif
1174 : #if CYTHON_USE_ASYNC_SLOTS
1175 : #if PY_VERSION_HEX >= 0x030500B1
1176 : #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1177 : #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1178 : #else
1179 : #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1180 : #endif
1181 : #else
1182 : #define __Pyx_PyType_AsAsync(obj) NULL
1183 : #endif
1184 : #ifndef __Pyx_PyAsyncMethodsStruct
1185 : typedef struct {
1186 : unaryfunc am_await;
1187 : unaryfunc am_aiter;
1188 : unaryfunc am_anext;
1189 : } __Pyx_PyAsyncMethodsStruct;
1190 : #endif
1191 :
1192 : #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1193 : #if !defined(_USE_MATH_DEFINES)
1194 : #define _USE_MATH_DEFINES
1195 : #endif
1196 : #endif
1197 : #include <math.h>
1198 : #ifdef NAN
1199 : #define __PYX_NAN() ((float) NAN)
1200 : #else
1201 : static CYTHON_INLINE float __PYX_NAN() {
1202 : float value;
1203 : memset(&value, 0xFF, sizeof(value));
1204 : return value;
1205 : }
1206 : #endif
1207 : #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1208 : #define __Pyx_truncl trunc
1209 : #else
1210 : #define __Pyx_truncl truncl
1211 : #endif
1212 :
1213 : #define __PYX_MARK_ERR_POS(f_index, lineno) \
1214 : { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1215 : #define __PYX_ERR(f_index, lineno, Ln_error) \
1216 : { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1217 :
1218 : #ifdef CYTHON_EXTERN_C
1219 : #undef __PYX_EXTERN_C
1220 : #define __PYX_EXTERN_C CYTHON_EXTERN_C
1221 : #elif defined(__PYX_EXTERN_C)
1222 : #ifdef _MSC_VER
1223 : #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1224 : #else
1225 : #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1226 : #endif
1227 : #else
1228 : #define __PYX_EXTERN_C extern "C++"
1229 : #endif
1230 :
1231 : #define __PYX_HAVE__scipy__interpolate___bspl
1232 : #define __PYX_HAVE_API__scipy__interpolate___bspl
1233 : /* Early includes */
1234 : #include <string.h>
1235 : #include <stdio.h>
1236 :
1237 : /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1238 :
1239 : #include "numpy/arrayobject.h"
1240 : #include "numpy/ndarrayobject.h"
1241 : #include "numpy/ndarraytypes.h"
1242 : #include "numpy/arrayscalars.h"
1243 : #include "numpy/ufuncobject.h"
1244 : #include <math.h>
1245 : #include "ios"
1246 : #include "new"
1247 : #include "stdexcept"
1248 : #include "typeinfo"
1249 : #include "src/__fitpack.h"
1250 : #include "pythread.h"
1251 : #include <stdlib.h>
1252 : #ifdef _OPENMP
1253 : #include <omp.h>
1254 : #endif /* _OPENMP */
1255 :
1256 : #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1257 : #define CYTHON_WITHOUT_ASSERTIONS
1258 : #endif
1259 :
1260 : typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1261 : const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1262 :
1263 : #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1264 : #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1265 : #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1266 : #define __PYX_DEFAULT_STRING_ENCODING ""
1267 : #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1268 : #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1269 : #define __Pyx_uchar_cast(c) ((unsigned char)c)
1270 : #define __Pyx_long_cast(x) ((long)x)
1271 : #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1272 : (sizeof(type) < sizeof(Py_ssize_t)) ||\
1273 : (sizeof(type) > sizeof(Py_ssize_t) &&\
1274 : likely(v < (type)PY_SSIZE_T_MAX ||\
1275 : v == (type)PY_SSIZE_T_MAX) &&\
1276 : (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1277 : v == (type)PY_SSIZE_T_MIN))) ||\
1278 : (sizeof(type) == sizeof(Py_ssize_t) &&\
1279 : (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1280 : v == (type)PY_SSIZE_T_MAX))) )
1281 2834 : static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1282 2834 : return (size_t) i < (size_t) limit;
1283 : }
1284 : #if defined (__cplusplus) && __cplusplus >= 201103L
1285 : #include <cstdlib>
1286 : #define __Pyx_sst_abs(value) std::abs(value)
1287 : #elif SIZEOF_INT >= SIZEOF_SIZE_T
1288 : #define __Pyx_sst_abs(value) abs(value)
1289 : #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1290 : #define __Pyx_sst_abs(value) labs(value)
1291 : #elif defined (_MSC_VER)
1292 : #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1293 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1294 : #define __Pyx_sst_abs(value) llabs(value)
1295 : #elif defined (__GNUC__)
1296 : #define __Pyx_sst_abs(value) __builtin_llabs(value)
1297 : #else
1298 : #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1299 : #endif
1300 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1301 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1302 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1303 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1304 : #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1305 : #define __Pyx_PyBytes_FromString PyBytes_FromString
1306 : #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1307 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1308 : #if PY_MAJOR_VERSION < 3
1309 : #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1310 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1311 : #else
1312 : #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1313 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1314 : #endif
1315 : #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1316 : #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1317 : #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1318 : #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1319 : #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1320 : #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1321 : #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1322 : #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1323 : #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1324 : #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1325 : #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1326 : #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1327 : #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1328 : #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1329 : #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1330 : #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1331 : #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1332 : #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1333 : #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1334 : #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1335 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1336 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1337 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1338 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1339 : #define __Pyx_PySequence_Tuple(obj)\
1340 : (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1341 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1342 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1343 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1344 : #if CYTHON_ASSUME_SAFE_MACROS
1345 : #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1346 : #else
1347 : #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1348 : #endif
1349 : #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1350 : #if PY_MAJOR_VERSION >= 3
1351 : #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1352 : #else
1353 : #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1354 : #endif
1355 : #if CYTHON_USE_PYLONG_INTERNALS
1356 : #if PY_VERSION_HEX >= 0x030C00A7
1357 : #ifndef _PyLong_SIGN_MASK
1358 : #define _PyLong_SIGN_MASK 3
1359 : #endif
1360 : #ifndef _PyLong_NON_SIZE_BITS
1361 : #define _PyLong_NON_SIZE_BITS 3
1362 : #endif
1363 : #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1364 : #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1365 : #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1366 : #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1367 : #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1368 : #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1369 : #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1370 : #define __Pyx_PyLong_SignedDigitCount(x)\
1371 : ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1372 : #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1373 : #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1374 : #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1375 : #else
1376 : #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1377 : #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1378 : #endif
1379 : typedef Py_ssize_t __Pyx_compact_pylong;
1380 : typedef size_t __Pyx_compact_upylong;
1381 : #else
1382 : #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1383 : #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1384 : #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1385 : #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1386 : #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1387 : #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1388 : #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1389 : #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1390 : #define __Pyx_PyLong_CompactValue(x)\
1391 : ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1392 : typedef sdigit __Pyx_compact_pylong;
1393 : typedef digit __Pyx_compact_upylong;
1394 : #endif
1395 : #if PY_VERSION_HEX >= 0x030C00A5
1396 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1397 : #else
1398 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1399 : #endif
1400 : #endif
1401 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1402 : #include <string.h>
1403 : static int __Pyx_sys_getdefaultencoding_not_ascii;
1404 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1405 : PyObject* sys;
1406 : PyObject* default_encoding = NULL;
1407 : PyObject* ascii_chars_u = NULL;
1408 : PyObject* ascii_chars_b = NULL;
1409 : const char* default_encoding_c;
1410 : sys = PyImport_ImportModule("sys");
1411 : if (!sys) goto bad;
1412 : default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1413 : Py_DECREF(sys);
1414 : if (!default_encoding) goto bad;
1415 : default_encoding_c = PyBytes_AsString(default_encoding);
1416 : if (!default_encoding_c) goto bad;
1417 : if (strcmp(default_encoding_c, "ascii") == 0) {
1418 : __Pyx_sys_getdefaultencoding_not_ascii = 0;
1419 : } else {
1420 : char ascii_chars[128];
1421 : int c;
1422 : for (c = 0; c < 128; c++) {
1423 : ascii_chars[c] = (char) c;
1424 : }
1425 : __Pyx_sys_getdefaultencoding_not_ascii = 1;
1426 : ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1427 : if (!ascii_chars_u) goto bad;
1428 : ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1429 : if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1430 : PyErr_Format(
1431 : PyExc_ValueError,
1432 : "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1433 : default_encoding_c);
1434 : goto bad;
1435 : }
1436 : Py_DECREF(ascii_chars_u);
1437 : Py_DECREF(ascii_chars_b);
1438 : }
1439 : Py_DECREF(default_encoding);
1440 : return 0;
1441 : bad:
1442 : Py_XDECREF(default_encoding);
1443 : Py_XDECREF(ascii_chars_u);
1444 : Py_XDECREF(ascii_chars_b);
1445 : return -1;
1446 : }
1447 : #endif
1448 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1449 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1450 : #else
1451 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1452 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1453 : #include <string.h>
1454 : static char* __PYX_DEFAULT_STRING_ENCODING;
1455 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1456 : PyObject* sys;
1457 : PyObject* default_encoding = NULL;
1458 : char* default_encoding_c;
1459 : sys = PyImport_ImportModule("sys");
1460 : if (!sys) goto bad;
1461 : default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1462 : Py_DECREF(sys);
1463 : if (!default_encoding) goto bad;
1464 : default_encoding_c = PyBytes_AsString(default_encoding);
1465 : if (!default_encoding_c) goto bad;
1466 : __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1467 : if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1468 : strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1469 : Py_DECREF(default_encoding);
1470 : return 0;
1471 : bad:
1472 : Py_XDECREF(default_encoding);
1473 : return -1;
1474 : }
1475 : #endif
1476 : #endif
1477 :
1478 :
1479 : /* Test for GCC > 2.95 */
1480 : #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1481 : #define likely(x) __builtin_expect(!!(x), 1)
1482 : #define unlikely(x) __builtin_expect(!!(x), 0)
1483 : #else /* !__GNUC__ or GCC < 2.95 */
1484 : #define likely(x) (x)
1485 : #define unlikely(x) (x)
1486 : #endif /* __GNUC__ */
1487 : static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1488 :
1489 : #if !CYTHON_USE_MODULE_STATE
1490 : static PyObject *__pyx_m = NULL;
1491 : #endif
1492 : static int __pyx_lineno;
1493 : static int __pyx_clineno = 0;
1494 : static const char * __pyx_cfilenm = __FILE__;
1495 : static const char *__pyx_filename;
1496 :
1497 : /* Header.proto */
1498 : #if !defined(CYTHON_CCOMPLEX)
1499 : #if defined(__cplusplus)
1500 : #define CYTHON_CCOMPLEX 1
1501 : #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1502 : #define CYTHON_CCOMPLEX 1
1503 : #else
1504 : #define CYTHON_CCOMPLEX 0
1505 : #endif
1506 : #endif
1507 : #if CYTHON_CCOMPLEX
1508 : #ifdef __cplusplus
1509 : #include <complex>
1510 : #else
1511 : #include <complex.h>
1512 : #endif
1513 : #endif
1514 : #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1515 : #undef _Complex_I
1516 : #define _Complex_I 1.0fj
1517 : #endif
1518 :
1519 : /* #### Code section: filename_table ### */
1520 :
1521 : static const char *__pyx_f[] = {
1522 : "_bspl.pyx",
1523 : "<stringsource>",
1524 : "__init__.cython-30.pxd",
1525 : "type.pxd",
1526 : };
1527 : /* #### Code section: utility_code_proto_before_types ### */
1528 : /* ForceInitThreads.proto */
1529 : #ifndef __PYX_FORCE_INIT_THREADS
1530 : #define __PYX_FORCE_INIT_THREADS 0
1531 : #endif
1532 :
1533 : /* NoFastGil.proto */
1534 : #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1535 : #define __Pyx_PyGILState_Release PyGILState_Release
1536 : #define __Pyx_FastGIL_Remember()
1537 : #define __Pyx_FastGIL_Forget()
1538 : #define __Pyx_FastGilFuncInit()
1539 :
1540 : /* BufferFormatStructs.proto */
1541 : struct __Pyx_StructField_;
1542 : #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1543 : typedef struct {
1544 : const char* name;
1545 : struct __Pyx_StructField_* fields;
1546 : size_t size;
1547 : size_t arraysize[8];
1548 : int ndim;
1549 : char typegroup;
1550 : char is_unsigned;
1551 : int flags;
1552 : } __Pyx_TypeInfo;
1553 : typedef struct __Pyx_StructField_ {
1554 : __Pyx_TypeInfo* type;
1555 : const char* name;
1556 : size_t offset;
1557 : } __Pyx_StructField;
1558 : typedef struct {
1559 : __Pyx_StructField* field;
1560 : size_t parent_offset;
1561 : } __Pyx_BufFmt_StackElem;
1562 : typedef struct {
1563 : __Pyx_StructField root;
1564 : __Pyx_BufFmt_StackElem* head;
1565 : size_t fmt_offset;
1566 : size_t new_count, enc_count;
1567 : size_t struct_alignment;
1568 : int is_complex;
1569 : char enc_type;
1570 : char new_packmode;
1571 : char enc_packmode;
1572 : char is_valid_array;
1573 : } __Pyx_BufFmt_Context;
1574 :
1575 : /* Atomics.proto */
1576 : #include <pythread.h>
1577 : #ifndef CYTHON_ATOMICS
1578 : #define CYTHON_ATOMICS 1
1579 : #endif
1580 : #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1581 : #define __pyx_atomic_int_type int
1582 : #define __pyx_nonatomic_int_type int
1583 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1584 : (__STDC_VERSION__ >= 201112L) &&\
1585 : !defined(__STDC_NO_ATOMICS__))
1586 : #include <stdatomic.h>
1587 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1588 : (__cplusplus >= 201103L) ||\
1589 : (defined(_MSC_VER) && _MSC_VER >= 1700)))
1590 : #include <atomic>
1591 : #endif
1592 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1593 : (__STDC_VERSION__ >= 201112L) &&\
1594 : !defined(__STDC_NO_ATOMICS__) &&\
1595 : ATOMIC_INT_LOCK_FREE == 2)
1596 : #undef __pyx_atomic_int_type
1597 : #define __pyx_atomic_int_type atomic_int
1598 : #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1599 : #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1600 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1601 : #pragma message ("Using standard C atomics")
1602 : #elif defined(__PYX_DEBUG_ATOMICS)
1603 : #warning "Using standard C atomics"
1604 : #endif
1605 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1606 : (__cplusplus >= 201103L) ||\
1607 : \
1608 : (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1609 : ATOMIC_INT_LOCK_FREE == 2)
1610 : #undef __pyx_atomic_int_type
1611 : #define __pyx_atomic_int_type std::atomic_int
1612 : #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1613 : #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1614 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1615 : #pragma message ("Using standard C++ atomics")
1616 : #elif defined(__PYX_DEBUG_ATOMICS)
1617 : #warning "Using standard C++ atomics"
1618 : #endif
1619 : #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1620 : (__GNUC_MINOR__ > 1 ||\
1621 : (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1622 : #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1623 : #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1624 : #ifdef __PYX_DEBUG_ATOMICS
1625 : #warning "Using GNU atomics"
1626 : #endif
1627 : #elif CYTHON_ATOMICS && defined(_MSC_VER)
1628 : #include <intrin.h>
1629 : #undef __pyx_atomic_int_type
1630 : #define __pyx_atomic_int_type long
1631 : #undef __pyx_nonatomic_int_type
1632 : #define __pyx_nonatomic_int_type long
1633 : #pragma intrinsic (_InterlockedExchangeAdd)
1634 : #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1635 : #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1636 : #ifdef __PYX_DEBUG_ATOMICS
1637 : #pragma message ("Using MSVC atomics")
1638 : #endif
1639 : #else
1640 : #undef CYTHON_ATOMICS
1641 : #define CYTHON_ATOMICS 0
1642 : #ifdef __PYX_DEBUG_ATOMICS
1643 : #warning "Not using atomics"
1644 : #endif
1645 : #endif
1646 : #if CYTHON_ATOMICS
1647 : #define __pyx_add_acquisition_count(memview)\
1648 : __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1649 : #define __pyx_sub_acquisition_count(memview)\
1650 : __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1651 : #else
1652 : #define __pyx_add_acquisition_count(memview)\
1653 : __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1654 : #define __pyx_sub_acquisition_count(memview)\
1655 : __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1656 : #endif
1657 :
1658 : /* MemviewSliceStruct.proto */
1659 : struct __pyx_memoryview_obj;
1660 : typedef struct {
1661 : struct __pyx_memoryview_obj *memview;
1662 : char *data;
1663 : Py_ssize_t shape[8];
1664 : Py_ssize_t strides[8];
1665 : Py_ssize_t suboffsets[8];
1666 : } __Pyx_memviewslice;
1667 : #define __Pyx_MemoryView_Len(m) (m.shape[0])
1668 :
1669 : /* #### Code section: numeric_typedefs ### */
1670 :
1671 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769
1672 : * # in Cython to enable them only on the right systems.
1673 : *
1674 : * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1675 : * ctypedef npy_int16 int16_t
1676 : * ctypedef npy_int32 int32_t
1677 : */
1678 : typedef npy_int8 __pyx_t_5numpy_int8_t;
1679 :
1680 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
1681 : *
1682 : * ctypedef npy_int8 int8_t
1683 : * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1684 : * ctypedef npy_int32 int32_t
1685 : * ctypedef npy_int64 int64_t
1686 : */
1687 : typedef npy_int16 __pyx_t_5numpy_int16_t;
1688 :
1689 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
1690 : * ctypedef npy_int8 int8_t
1691 : * ctypedef npy_int16 int16_t
1692 : * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1693 : * ctypedef npy_int64 int64_t
1694 : * #ctypedef npy_int96 int96_t
1695 : */
1696 : typedef npy_int32 __pyx_t_5numpy_int32_t;
1697 :
1698 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
1699 : * ctypedef npy_int16 int16_t
1700 : * ctypedef npy_int32 int32_t
1701 : * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1702 : * #ctypedef npy_int96 int96_t
1703 : * #ctypedef npy_int128 int128_t
1704 : */
1705 : typedef npy_int64 __pyx_t_5numpy_int64_t;
1706 :
1707 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776
1708 : * #ctypedef npy_int128 int128_t
1709 : *
1710 : * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1711 : * ctypedef npy_uint16 uint16_t
1712 : * ctypedef npy_uint32 uint32_t
1713 : */
1714 : typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1715 :
1716 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
1717 : *
1718 : * ctypedef npy_uint8 uint8_t
1719 : * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1720 : * ctypedef npy_uint32 uint32_t
1721 : * ctypedef npy_uint64 uint64_t
1722 : */
1723 : typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1724 :
1725 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
1726 : * ctypedef npy_uint8 uint8_t
1727 : * ctypedef npy_uint16 uint16_t
1728 : * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1729 : * ctypedef npy_uint64 uint64_t
1730 : * #ctypedef npy_uint96 uint96_t
1731 : */
1732 : typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1733 :
1734 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
1735 : * ctypedef npy_uint16 uint16_t
1736 : * ctypedef npy_uint32 uint32_t
1737 : * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1738 : * #ctypedef npy_uint96 uint96_t
1739 : * #ctypedef npy_uint128 uint128_t
1740 : */
1741 : typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1742 :
1743 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783
1744 : * #ctypedef npy_uint128 uint128_t
1745 : *
1746 : * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1747 : * ctypedef npy_float64 float64_t
1748 : * #ctypedef npy_float80 float80_t
1749 : */
1750 : typedef npy_float32 __pyx_t_5numpy_float32_t;
1751 :
1752 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
1753 : *
1754 : * ctypedef npy_float32 float32_t
1755 : * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1756 : * #ctypedef npy_float80 float80_t
1757 : * #ctypedef npy_float128 float128_t
1758 : */
1759 : typedef npy_float64 __pyx_t_5numpy_float64_t;
1760 :
1761 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791
1762 : * ctypedef double complex complex128_t
1763 : *
1764 : * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1765 : * ctypedef npy_ulonglong ulonglong_t
1766 : *
1767 : */
1768 : typedef npy_longlong __pyx_t_5numpy_longlong_t;
1769 :
1770 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
1771 : *
1772 : * ctypedef npy_longlong longlong_t
1773 : * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1774 : *
1775 : * ctypedef npy_intp intp_t
1776 : */
1777 : typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1778 :
1779 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
1780 : * ctypedef npy_ulonglong ulonglong_t
1781 : *
1782 : * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1783 : * ctypedef npy_uintp uintp_t
1784 : *
1785 : */
1786 : typedef npy_intp __pyx_t_5numpy_intp_t;
1787 :
1788 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
1789 : *
1790 : * ctypedef npy_intp intp_t
1791 : * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1792 : *
1793 : * ctypedef npy_double float_t
1794 : */
1795 : typedef npy_uintp __pyx_t_5numpy_uintp_t;
1796 :
1797 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
1798 : * ctypedef npy_uintp uintp_t
1799 : *
1800 : * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1801 : * ctypedef npy_double double_t
1802 : * ctypedef npy_longdouble longdouble_t
1803 : */
1804 : typedef npy_double __pyx_t_5numpy_float_t;
1805 :
1806 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
1807 : *
1808 : * ctypedef npy_double float_t
1809 : * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1810 : * ctypedef npy_longdouble longdouble_t
1811 : *
1812 : */
1813 : typedef npy_double __pyx_t_5numpy_double_t;
1814 :
1815 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
1816 : * ctypedef npy_double float_t
1817 : * ctypedef npy_double double_t
1818 : * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1819 : *
1820 : * ctypedef float complex cfloat_t
1821 : */
1822 : typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1823 : /* #### Code section: complex_type_declarations ### */
1824 : /* Declarations.proto */
1825 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1826 : #ifdef __cplusplus
1827 : typedef ::std::complex< float > __pyx_t_float_complex;
1828 : #else
1829 : typedef float _Complex __pyx_t_float_complex;
1830 : #endif
1831 : #else
1832 : typedef struct { float real, imag; } __pyx_t_float_complex;
1833 : #endif
1834 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1835 :
1836 : /* Declarations.proto */
1837 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1838 : #ifdef __cplusplus
1839 : typedef ::std::complex< double > __pyx_t_double_complex;
1840 : #else
1841 : typedef double _Complex __pyx_t_double_complex;
1842 : #endif
1843 : #else
1844 : typedef struct { double real, imag; } __pyx_t_double_complex;
1845 : #endif
1846 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1847 :
1848 : /* Declarations.proto */
1849 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1850 : #ifdef __cplusplus
1851 : typedef ::std::complex< long double > __pyx_t_long_double_complex;
1852 : #else
1853 : typedef long double _Complex __pyx_t_long_double_complex;
1854 : #endif
1855 : #else
1856 : typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1857 : #endif
1858 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1859 :
1860 : /* #### Code section: type_declarations ### */
1861 :
1862 : /*--- Type declarations ---*/
1863 : struct __pyx_array_obj;
1864 : struct __pyx_MemviewEnum_obj;
1865 : struct __pyx_memoryview_obj;
1866 : struct __pyx_memoryviewslice_obj;
1867 :
1868 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
1869 : *
1870 : * # Iterator API added in v1.6
1871 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<<
1872 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
1873 : *
1874 : */
1875 : typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);
1876 :
1877 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
1878 : * # Iterator API added in v1.6
1879 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
1880 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<<
1881 : *
1882 : * cdef extern from "numpy/arrayobject.h":
1883 : */
1884 : typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
1885 : struct __pyx_defaults;
1886 : typedef struct __pyx_defaults __pyx_defaults;
1887 : struct __pyx_defaults {
1888 : PyObject *__pyx_arg__fused_sigindex;
1889 : };
1890 :
1891 : /* "View.MemoryView":114
1892 : * @cython.collection_type("sequence")
1893 : * @cname("__pyx_array")
1894 : * cdef class array: # <<<<<<<<<<<<<<
1895 : *
1896 : * cdef:
1897 : */
1898 : struct __pyx_array_obj {
1899 : PyObject_HEAD
1900 : struct __pyx_vtabstruct_array *__pyx_vtab;
1901 : char *data;
1902 : Py_ssize_t len;
1903 : char *format;
1904 : int ndim;
1905 : Py_ssize_t *_shape;
1906 : Py_ssize_t *_strides;
1907 : Py_ssize_t itemsize;
1908 : PyObject *mode;
1909 : PyObject *_format;
1910 : void (*callback_free_data)(void *);
1911 : int free_data;
1912 : int dtype_is_object;
1913 : };
1914 :
1915 :
1916 : /* "View.MemoryView":302
1917 : *
1918 : * @cname('__pyx_MemviewEnum')
1919 : * cdef class Enum(object): # <<<<<<<<<<<<<<
1920 : * cdef object name
1921 : * def __init__(self, name):
1922 : */
1923 : struct __pyx_MemviewEnum_obj {
1924 : PyObject_HEAD
1925 : PyObject *name;
1926 : };
1927 :
1928 :
1929 : /* "View.MemoryView":337
1930 : *
1931 : * @cname('__pyx_memoryview')
1932 : * cdef class memoryview: # <<<<<<<<<<<<<<
1933 : *
1934 : * cdef object obj
1935 : */
1936 : struct __pyx_memoryview_obj {
1937 : PyObject_HEAD
1938 : struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1939 : PyObject *obj;
1940 : PyObject *_size;
1941 : PyObject *_array_interface;
1942 : PyThread_type_lock lock;
1943 : __pyx_atomic_int_type acquisition_count;
1944 : Py_buffer view;
1945 : int flags;
1946 : int dtype_is_object;
1947 : __Pyx_TypeInfo *typeinfo;
1948 : };
1949 :
1950 :
1951 : /* "View.MemoryView":952
1952 : * @cython.collection_type("sequence")
1953 : * @cname('__pyx_memoryviewslice')
1954 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1955 : * "Internal class for passing memoryview slices to Python"
1956 : *
1957 : */
1958 : struct __pyx_memoryviewslice_obj {
1959 : struct __pyx_memoryview_obj __pyx_base;
1960 : __Pyx_memviewslice from_slice;
1961 : PyObject *from_object;
1962 : PyObject *(*to_object_func)(char *);
1963 : int (*to_dtype_func)(char *, PyObject *);
1964 : };
1965 :
1966 :
1967 :
1968 : /* "View.MemoryView":114
1969 : * @cython.collection_type("sequence")
1970 : * @cname("__pyx_array")
1971 : * cdef class array: # <<<<<<<<<<<<<<
1972 : *
1973 : * cdef:
1974 : */
1975 :
1976 : struct __pyx_vtabstruct_array {
1977 : PyObject *(*get_memview)(struct __pyx_array_obj *);
1978 : };
1979 : static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1980 :
1981 :
1982 : /* "View.MemoryView":337
1983 : *
1984 : * @cname('__pyx_memoryview')
1985 : * cdef class memoryview: # <<<<<<<<<<<<<<
1986 : *
1987 : * cdef object obj
1988 : */
1989 :
1990 : struct __pyx_vtabstruct_memoryview {
1991 : char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1992 : PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1993 : PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1994 : PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1995 : PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1996 : PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1997 : PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1998 : PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
1999 : };
2000 : static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
2001 :
2002 :
2003 : /* "View.MemoryView":952
2004 : * @cython.collection_type("sequence")
2005 : * @cname('__pyx_memoryviewslice')
2006 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
2007 : * "Internal class for passing memoryview slices to Python"
2008 : *
2009 : */
2010 :
2011 : struct __pyx_vtabstruct__memoryviewslice {
2012 : struct __pyx_vtabstruct_memoryview __pyx_base;
2013 : };
2014 : static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
2015 : /* #### Code section: utility_code_proto ### */
2016 :
2017 : /* --- Runtime support code (head) --- */
2018 : /* Refnanny.proto */
2019 : #ifndef CYTHON_REFNANNY
2020 : #define CYTHON_REFNANNY 0
2021 : #endif
2022 : #if CYTHON_REFNANNY
2023 : typedef struct {
2024 : void (*INCREF)(void*, PyObject*, Py_ssize_t);
2025 : void (*DECREF)(void*, PyObject*, Py_ssize_t);
2026 : void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2027 : void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2028 : void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2029 : void (*FinishContext)(void**);
2030 : } __Pyx_RefNannyAPIStruct;
2031 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2032 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2033 : #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2034 : #ifdef WITH_THREAD
2035 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2036 : if (acquire_gil) {\
2037 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2038 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2039 : PyGILState_Release(__pyx_gilstate_save);\
2040 : } else {\
2041 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2042 : }
2043 : #define __Pyx_RefNannyFinishContextNogil() {\
2044 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2045 : __Pyx_RefNannyFinishContext();\
2046 : PyGILState_Release(__pyx_gilstate_save);\
2047 : }
2048 : #else
2049 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2050 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
2051 : #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
2052 : #endif
2053 : #define __Pyx_RefNannyFinishContextNogil() {\
2054 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2055 : __Pyx_RefNannyFinishContext();\
2056 : PyGILState_Release(__pyx_gilstate_save);\
2057 : }
2058 : #define __Pyx_RefNannyFinishContext()\
2059 : __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2060 : #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2061 : #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2062 : #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2063 : #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2064 : #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2065 : #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2066 : #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2067 : #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2068 : #else
2069 : #define __Pyx_RefNannyDeclarations
2070 : #define __Pyx_RefNannySetupContext(name, acquire_gil)
2071 : #define __Pyx_RefNannyFinishContextNogil()
2072 : #define __Pyx_RefNannyFinishContext()
2073 : #define __Pyx_INCREF(r) Py_INCREF(r)
2074 : #define __Pyx_DECREF(r) Py_DECREF(r)
2075 : #define __Pyx_GOTREF(r)
2076 : #define __Pyx_GIVEREF(r)
2077 : #define __Pyx_XINCREF(r) Py_XINCREF(r)
2078 : #define __Pyx_XDECREF(r) Py_XDECREF(r)
2079 : #define __Pyx_XGOTREF(r)
2080 : #define __Pyx_XGIVEREF(r)
2081 : #endif
2082 : #define __Pyx_Py_XDECREF_SET(r, v) do {\
2083 : PyObject *tmp = (PyObject *) r;\
2084 : r = v; Py_XDECREF(tmp);\
2085 : } while (0)
2086 : #define __Pyx_XDECREF_SET(r, v) do {\
2087 : PyObject *tmp = (PyObject *) r;\
2088 : r = v; __Pyx_XDECREF(tmp);\
2089 : } while (0)
2090 : #define __Pyx_DECREF_SET(r, v) do {\
2091 : PyObject *tmp = (PyObject *) r;\
2092 : r = v; __Pyx_DECREF(tmp);\
2093 : } while (0)
2094 : #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2095 : #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2096 :
2097 : /* PyErrExceptionMatches.proto */
2098 : #if CYTHON_FAST_THREAD_STATE
2099 : #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2100 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2101 : #else
2102 : #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2103 : #endif
2104 :
2105 : /* PyThreadStateGet.proto */
2106 : #if CYTHON_FAST_THREAD_STATE
2107 : #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2108 : #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2109 : #if PY_VERSION_HEX >= 0x030C00A6
2110 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2111 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2112 : #else
2113 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2114 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2115 : #endif
2116 : #else
2117 : #define __Pyx_PyThreadState_declare
2118 : #define __Pyx_PyThreadState_assign
2119 : #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2120 : #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2121 : #endif
2122 :
2123 : /* PyErrFetchRestore.proto */
2124 : #if CYTHON_FAST_THREAD_STATE
2125 : #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2126 : #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2127 : #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2128 : #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2129 : #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2130 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2131 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2132 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2133 : #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2134 : #else
2135 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2136 : #endif
2137 : #else
2138 : #define __Pyx_PyErr_Clear() PyErr_Clear()
2139 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2140 : #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2141 : #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2142 : #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2143 : #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2144 : #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2145 : #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2146 : #endif
2147 :
2148 : /* PyObjectGetAttrStr.proto */
2149 : #if CYTHON_USE_TYPE_SLOTS
2150 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2151 : #else
2152 : #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2153 : #endif
2154 :
2155 : /* PyObjectGetAttrStrNoError.proto */
2156 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2157 :
2158 : /* GetBuiltinName.proto */
2159 : static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2160 :
2161 : /* TupleAndListFromArray.proto */
2162 : #if CYTHON_COMPILING_IN_CPYTHON
2163 : static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2164 : static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2165 : #endif
2166 :
2167 : /* IncludeStringH.proto */
2168 : #include <string.h>
2169 :
2170 : /* BytesEquals.proto */
2171 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2172 :
2173 : /* UnicodeEquals.proto */
2174 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2175 :
2176 : /* fastcall.proto */
2177 : #if CYTHON_AVOID_BORROWED_REFS
2178 : #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2179 : #elif CYTHON_ASSUME_SAFE_MACROS
2180 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2181 : #else
2182 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2183 : #endif
2184 : #if CYTHON_AVOID_BORROWED_REFS
2185 : #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2186 : #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2187 : #else
2188 : #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2189 : #define __Pyx_Arg_XDECREF_VARARGS(arg)
2190 : #endif
2191 : #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2192 : #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2193 : #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2194 : #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2195 : #if CYTHON_METH_FASTCALL
2196 : #define __Pyx_Arg_FASTCALL(args, i) args[i]
2197 : #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2198 : #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2199 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2200 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2201 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2202 : #else
2203 : #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2204 : #endif
2205 : #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2206 : to have the same reference counting */
2207 : #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2208 : #else
2209 : #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2210 : #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2211 : #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2212 : #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2213 : #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2214 : #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2215 : #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2216 : #endif
2217 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2218 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2219 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2220 : #else
2221 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2222 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2223 : #endif
2224 :
2225 : /* RaiseArgTupleInvalid.proto */
2226 : static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2227 : Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2228 :
2229 : /* RaiseDoubleKeywords.proto */
2230 : static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2231 :
2232 : /* ParseKeywords.proto */
2233 : static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2234 : PyObject **argnames[],
2235 : PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2236 : const char* function_name);
2237 :
2238 : /* ArgTypeTest.proto */
2239 : #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2240 : ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2241 : __Pyx__ArgTypeTest(obj, type, name, exact))
2242 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2243 :
2244 : /* RaiseException.proto */
2245 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2246 :
2247 : /* PyFunctionFastCall.proto */
2248 : #if CYTHON_FAST_PYCALL
2249 : #if !CYTHON_VECTORCALL
2250 : #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2251 : __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2252 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2253 : #endif
2254 : #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2255 : (sizeof(char [1 - 2*!(cond)]) - 1)
2256 : #ifndef Py_MEMBER_SIZE
2257 : #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2258 : #endif
2259 : #if !CYTHON_VECTORCALL
2260 : #if PY_VERSION_HEX >= 0x03080000
2261 : #include "frameobject.h"
2262 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2263 : #ifndef Py_BUILD_CORE
2264 : #define Py_BUILD_CORE 1
2265 : #endif
2266 : #include "internal/pycore_frame.h"
2267 : #endif
2268 : #define __Pxy_PyFrame_Initialize_Offsets()
2269 : #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2270 : #else
2271 : static size_t __pyx_pyframe_localsplus_offset = 0;
2272 : #include "frameobject.h"
2273 : #define __Pxy_PyFrame_Initialize_Offsets()\
2274 : ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2275 : (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2276 : #define __Pyx_PyFrame_GetLocalsplus(frame)\
2277 : (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2278 : #endif
2279 : #endif
2280 : #endif
2281 :
2282 : /* PyObjectCall.proto */
2283 : #if CYTHON_COMPILING_IN_CPYTHON
2284 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2285 : #else
2286 : #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2287 : #endif
2288 :
2289 : /* PyObjectCallMethO.proto */
2290 : #if CYTHON_COMPILING_IN_CPYTHON
2291 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2292 : #endif
2293 :
2294 : /* PyObjectFastCall.proto */
2295 : #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2296 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
2297 :
2298 : /* RaiseUnexpectedTypeError.proto */
2299 : static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2300 :
2301 : /* GCCDiagnostics.proto */
2302 : #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2303 : #define __Pyx_HAS_GCC_DIAGNOSTIC
2304 : #endif
2305 :
2306 : /* BuildPyUnicode.proto */
2307 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
2308 : int prepend_sign, char padding_char);
2309 :
2310 : /* CIntToPyUnicode.proto */
2311 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2312 :
2313 : /* CIntToPyUnicode.proto */
2314 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2315 :
2316 : /* JoinPyUnicode.proto */
2317 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2318 : Py_UCS4 max_char);
2319 :
2320 : /* StrEquals.proto */
2321 : #if PY_MAJOR_VERSION >= 3
2322 : #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2323 : #else
2324 : #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2325 : #endif
2326 :
2327 : /* PyObjectFormatSimple.proto */
2328 : #if CYTHON_COMPILING_IN_PYPY
2329 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2330 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2331 : PyObject_Format(s, f))
2332 : #elif PY_MAJOR_VERSION < 3
2333 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2334 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2335 : likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
2336 : PyObject_Format(s, f))
2337 : #elif CYTHON_USE_TYPE_SLOTS
2338 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2339 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2340 : likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2341 : likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2342 : PyObject_Format(s, f))
2343 : #else
2344 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2345 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2346 : PyObject_Format(s, f))
2347 : #endif
2348 :
2349 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2350 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2351 : /* GetAttr.proto */
2352 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2353 :
2354 : /* GetItemInt.proto */
2355 : #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2356 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2357 : __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2358 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2359 : __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2360 : #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2361 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2362 : __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2363 : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2364 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2365 : int wraparound, int boundscheck);
2366 : #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2367 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2368 : __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2369 : (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2370 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2371 : int wraparound, int boundscheck);
2372 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2373 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2374 : int is_list, int wraparound, int boundscheck);
2375 :
2376 : /* PyObjectCallOneArg.proto */
2377 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2378 :
2379 : /* ObjectGetItem.proto */
2380 : #if CYTHON_USE_TYPE_SLOTS
2381 : static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2382 : #else
2383 : #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2384 : #endif
2385 :
2386 : /* KeywordStringCheck.proto */
2387 : static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
2388 :
2389 : /* DivInt[Py_ssize_t].proto */
2390 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2391 :
2392 : /* UnaryNegOverflows.proto */
2393 : #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2394 : (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2395 :
2396 : /* GetAttr3.proto */
2397 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2398 :
2399 : /* PyDictVersioning.proto */
2400 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2401 : #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2402 : #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2403 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2404 : (version_var) = __PYX_GET_DICT_VERSION(dict);\
2405 : (cache_var) = (value);
2406 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2407 : static PY_UINT64_T __pyx_dict_version = 0;\
2408 : static PyObject *__pyx_dict_cached_value = NULL;\
2409 : if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2410 : (VAR) = __pyx_dict_cached_value;\
2411 : } else {\
2412 : (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2413 : __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2414 : }\
2415 : }
2416 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2417 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2418 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2419 : #else
2420 : #define __PYX_GET_DICT_VERSION(dict) (0)
2421 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2422 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2423 : #endif
2424 :
2425 : /* GetModuleGlobalName.proto */
2426 : #if CYTHON_USE_DICT_VERSIONS
2427 : #define __Pyx_GetModuleGlobalName(var, name) do {\
2428 : static PY_UINT64_T __pyx_dict_version = 0;\
2429 : static PyObject *__pyx_dict_cached_value = NULL;\
2430 : (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2431 : (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2432 : __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2433 : } while(0)
2434 : #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2435 : PY_UINT64_T __pyx_dict_version;\
2436 : PyObject *__pyx_dict_cached_value;\
2437 : (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2438 : } while(0)
2439 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2440 : #else
2441 : #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2442 : #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2443 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2444 : #endif
2445 :
2446 : /* AssertionsEnabled.proto */
2447 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2448 : #define __Pyx_init_assertions_enabled() (0)
2449 : #define __pyx_assertions_enabled() (1)
2450 : #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
2451 : static int __pyx_assertions_enabled_flag;
2452 : #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2453 3 : static int __Pyx_init_assertions_enabled(void) {
2454 3 : PyObject *builtins, *debug, *debug_str;
2455 3 : int flag;
2456 3 : builtins = PyEval_GetBuiltins();
2457 3 : if (!builtins) goto bad;
2458 3 : debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2459 3 : if (!debug_str) goto bad;
2460 3 : debug = PyObject_GetItem(builtins, debug_str);
2461 3 : Py_DECREF(debug_str);
2462 3 : if (!debug) goto bad;
2463 3 : flag = PyObject_IsTrue(debug);
2464 3 : Py_DECREF(debug);
2465 3 : if (flag == -1) goto bad;
2466 3 : __pyx_assertions_enabled_flag = flag;
2467 3 : return 0;
2468 0 : bad:
2469 0 : __pyx_assertions_enabled_flag = 1;
2470 0 : return -1;
2471 : }
2472 : #else
2473 : #define __Pyx_init_assertions_enabled() (0)
2474 : #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2475 : #endif
2476 :
2477 : /* RaiseTooManyValuesToUnpack.proto */
2478 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2479 :
2480 : /* RaiseNeedMoreValuesToUnpack.proto */
2481 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2482 :
2483 : /* RaiseNoneIterError.proto */
2484 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2485 :
2486 : /* ExtTypeTest.proto */
2487 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2488 :
2489 : /* GetTopmostException.proto */
2490 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2491 : static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2492 : #endif
2493 :
2494 : /* SaveResetException.proto */
2495 : #if CYTHON_FAST_THREAD_STATE
2496 : #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2497 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2498 : #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2499 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2500 : #else
2501 : #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2502 : #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2503 : #endif
2504 :
2505 : /* GetException.proto */
2506 : #if CYTHON_FAST_THREAD_STATE
2507 : #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2508 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2509 : #else
2510 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2511 : #endif
2512 :
2513 : /* SwapException.proto */
2514 : #if CYTHON_FAST_THREAD_STATE
2515 : #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2516 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2517 : #else
2518 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2519 : #endif
2520 :
2521 : /* Import.proto */
2522 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2523 :
2524 : /* ImportDottedModule.proto */
2525 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
2526 : #if PY_MAJOR_VERSION >= 3
2527 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
2528 : #endif
2529 :
2530 : /* FastTypeChecks.proto */
2531 : #if CYTHON_COMPILING_IN_CPYTHON
2532 : #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2533 : #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2534 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2535 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2536 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2537 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2538 : #else
2539 : #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2540 : #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2541 : #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2542 : #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2543 : #endif
2544 : #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2545 : #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2546 :
2547 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2548 : /* ListCompAppend.proto */
2549 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2550 0 : static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2551 0 : PyListObject* L = (PyListObject*) list;
2552 0 : Py_ssize_t len = Py_SIZE(list);
2553 0 : if (likely(L->allocated > len)) {
2554 0 : Py_INCREF(x);
2555 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2556 : L->ob_item[len] = x;
2557 : #else
2558 0 : PyList_SET_ITEM(list, len, x);
2559 : #endif
2560 0 : __Pyx_SET_SIZE(list, len + 1);
2561 0 : return 0;
2562 : }
2563 0 : return PyList_Append(list, x);
2564 : }
2565 : #else
2566 : #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2567 : #endif
2568 :
2569 : /* PySequenceMultiply.proto */
2570 : #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2571 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2572 :
2573 : /* SetItemInt.proto */
2574 : #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2575 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2576 : __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2577 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2578 : __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2579 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2580 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2581 : int is_list, int wraparound, int boundscheck);
2582 :
2583 : /* RaiseUnboundLocalError.proto */
2584 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2585 :
2586 : /* DivInt[long].proto */
2587 : static CYTHON_INLINE long __Pyx_div_long(long, long);
2588 :
2589 : /* PySequenceContains.proto */
2590 0 : static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2591 0 : int result = PySequence_Contains(seq, item);
2592 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2593 : }
2594 :
2595 : /* ImportFrom.proto */
2596 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2597 :
2598 : /* HasAttr.proto */
2599 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2600 :
2601 : /* BufferIndexError.proto */
2602 : static void __Pyx_RaiseBufferIndexError(int axis);
2603 :
2604 : /* SliceObject.proto */
2605 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
2606 : PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
2607 : PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
2608 : int has_cstart, int has_cstop, int wraparound);
2609 :
2610 : /* PyDictContains.proto */
2611 0 : static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
2612 0 : int result = PyDict_Contains(dict, item);
2613 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2614 : }
2615 :
2616 : /* DictGetItem.proto */
2617 : #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2618 : static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2619 : #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2620 : (likely(PyDict_CheckExact(obj)) ?\
2621 : __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2622 : #else
2623 : #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2624 : #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2625 : #endif
2626 :
2627 : /* UnicodeAsUCS4.proto */
2628 : static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
2629 :
2630 : /* object_ord.proto */
2631 : #if PY_MAJOR_VERSION >= 3
2632 : #define __Pyx_PyObject_Ord(c)\
2633 : (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
2634 : #else
2635 : #define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
2636 : #endif
2637 : static long __Pyx__PyObject_Ord(PyObject* c);
2638 :
2639 : /* memoryview_get_from_buffer.proto */
2640 : #if !CYTHON_COMPILING_IN_LIMITED_API || CYTHON_LIMITED_API >= 0x030b0000
2641 : #define __Pyx_PyMemoryView_Get_itemsize(o) PyMemoryView_GET_BUFFER(o)->itemsize
2642 : #else
2643 : // can't get format like this unfortunately. It's unicode via getattr
2644 : static Py_ssize_t __Pyx_PyMemoryView_Get_itemsize(PyObject *obj);
2645 : #endif
2646 :
2647 : /* memoryview_get_from_buffer.proto */
2648 : #if !CYTHON_COMPILING_IN_LIMITED_API || CYTHON_LIMITED_API >= 0x030b0000
2649 : #define __Pyx_PyMemoryView_Get_ndim(o) PyMemoryView_GET_BUFFER(o)->ndim
2650 : #else
2651 : // can't get format like this unfortunately. It's unicode via getattr
2652 : static int __Pyx_PyMemoryView_Get_ndim(PyObject *obj);
2653 : #endif
2654 :
2655 : /* IterFinish.proto */
2656 : static CYTHON_INLINE int __Pyx_IterFinish(void);
2657 :
2658 : /* PyObjectCallNoArg.proto */
2659 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2660 :
2661 : /* PyObjectGetMethod.proto */
2662 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2663 :
2664 : /* PyObjectCallMethod0.proto */
2665 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
2666 :
2667 : /* UnpackItemEndCheck.proto */
2668 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2669 :
2670 : /* UnpackTupleError.proto */
2671 : static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
2672 :
2673 : /* UnpackTuple2.proto */
2674 : #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
2675 : (likely(is_tuple || PyTuple_Check(tuple)) ?\
2676 : (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
2677 : __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
2678 : (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
2679 : __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
2680 : static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
2681 : PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
2682 : static int __Pyx_unpack_tuple2_generic(
2683 : PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
2684 :
2685 : /* dict_iter.proto */
2686 : static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
2687 : Py_ssize_t* p_orig_length, int* p_is_dict);
2688 : static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
2689 : PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
2690 :
2691 : /* ListExtend.proto */
2692 0 : static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
2693 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
2694 0 : PyObject* none = _PyList_Extend((PyListObject*)L, v);
2695 0 : if (unlikely(!none))
2696 : return -1;
2697 0 : Py_DECREF(none);
2698 : return 0;
2699 : #else
2700 : return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
2701 : #endif
2702 : }
2703 :
2704 : /* py_dict_values.proto */
2705 : static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
2706 :
2707 : /* UnpackUnboundCMethod.proto */
2708 : typedef struct {
2709 : PyObject *type;
2710 : PyObject **method_name;
2711 : PyCFunction func;
2712 : PyObject *method;
2713 : int flag;
2714 : } __Pyx_CachedCFunction;
2715 :
2716 : /* CallUnboundCMethod0.proto */
2717 : static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
2718 : #if CYTHON_COMPILING_IN_CPYTHON
2719 : #define __Pyx_CallUnboundCMethod0(cfunc, self)\
2720 : (likely((cfunc)->func) ?\
2721 : (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\
2722 : (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
2723 : (PY_VERSION_HEX >= 0x030700A0 ?\
2724 : (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
2725 : (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
2726 : (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
2727 : (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
2728 : (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
2729 : ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\
2730 : __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
2731 : __Pyx__CallUnboundCMethod0(cfunc, self))
2732 : #else
2733 : #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
2734 : #endif
2735 :
2736 : /* dict_getitem_default.proto */
2737 : static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
2738 :
2739 : /* CallUnboundCMethod1.proto */
2740 : static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
2741 : #if CYTHON_COMPILING_IN_CPYTHON
2742 : static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
2743 : #else
2744 : #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
2745 : #endif
2746 :
2747 : /* CallUnboundCMethod2.proto */
2748 : static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
2749 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
2750 : static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
2751 : #else
2752 : #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
2753 : #endif
2754 :
2755 : /* ListAppend.proto */
2756 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2757 55 : static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2758 55 : PyListObject* L = (PyListObject*) list;
2759 55 : Py_ssize_t len = Py_SIZE(list);
2760 55 : if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2761 0 : Py_INCREF(x);
2762 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2763 : L->ob_item[len] = x;
2764 : #else
2765 0 : PyList_SET_ITEM(list, len, x);
2766 : #endif
2767 0 : __Pyx_SET_SIZE(list, len + 1);
2768 0 : return 0;
2769 : }
2770 55 : return PyList_Append(list, x);
2771 : }
2772 : #else
2773 : #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2774 : #endif
2775 :
2776 : /* PyIntBinop.proto */
2777 : #if !CYTHON_COMPILING_IN_PYPY
2778 : static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2779 : #else
2780 : #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
2781 : (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2782 : #endif
2783 :
2784 : /* PyIntBinop.proto */
2785 : #if !CYTHON_COMPILING_IN_PYPY
2786 : static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2787 : #else
2788 : #define __Pyx_PyInt_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\
2789 : (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
2790 : #endif
2791 :
2792 : /* PyIntBinop.proto */
2793 : #if !CYTHON_COMPILING_IN_PYPY
2794 : static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
2795 : #else
2796 : #define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\
2797 : (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
2798 : #endif
2799 :
2800 : /* PyObjectFormatAndDecref.proto */
2801 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f);
2802 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f);
2803 :
2804 : /* PyObject_GenericGetAttrNoDict.proto */
2805 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2806 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2807 : #else
2808 : #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2809 : #endif
2810 :
2811 : /* PyObject_GenericGetAttr.proto */
2812 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2813 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2814 : #else
2815 : #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2816 : #endif
2817 :
2818 : /* IncludeStructmemberH.proto */
2819 : #include <structmember.h>
2820 :
2821 : /* FixUpExtensionType.proto */
2822 : #if CYTHON_USE_TYPE_SPECS
2823 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2824 : #endif
2825 :
2826 : /* ValidateBasesTuple.proto */
2827 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
2828 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
2829 : #endif
2830 :
2831 : /* PyType_Ready.proto */
2832 : CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2833 :
2834 : /* SetVTable.proto */
2835 : static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
2836 :
2837 : /* GetVTable.proto */
2838 : static void* __Pyx_GetVtable(PyTypeObject *type);
2839 :
2840 : /* MergeVTables.proto */
2841 : #if !CYTHON_COMPILING_IN_LIMITED_API
2842 : static int __Pyx_MergeVtables(PyTypeObject *type);
2843 : #endif
2844 :
2845 : /* SetupReduce.proto */
2846 : #if !CYTHON_COMPILING_IN_LIMITED_API
2847 : static int __Pyx_setup_reduce(PyObject* type_obj);
2848 : #endif
2849 :
2850 : /* TypeImport.proto */
2851 : #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2852 : #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2853 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2854 : #include <stdalign.h>
2855 : #endif
2856 : #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2857 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2858 : #else
2859 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2860 : #endif
2861 : enum __Pyx_ImportType_CheckSize_3_0_11 {
2862 : __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2863 : __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2864 : __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2865 : };
2866 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2867 : #endif
2868 :
2869 : /* FetchSharedCythonModule.proto */
2870 : static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2871 :
2872 : /* FetchCommonType.proto */
2873 : #if !CYTHON_USE_TYPE_SPECS
2874 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2875 : #else
2876 : static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2877 : #endif
2878 :
2879 : /* PyMethodNew.proto */
2880 : #if CYTHON_COMPILING_IN_LIMITED_API
2881 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2882 : PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
2883 : CYTHON_UNUSED_VAR(typ);
2884 : if (!self)
2885 : return __Pyx_NewRef(func);
2886 : typesModule = PyImport_ImportModule("types");
2887 : if (!typesModule) return NULL;
2888 : methodType = PyObject_GetAttrString(typesModule, "MethodType");
2889 : Py_DECREF(typesModule);
2890 : if (!methodType) return NULL;
2891 : result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
2892 : Py_DECREF(methodType);
2893 : return result;
2894 : }
2895 : #elif PY_MAJOR_VERSION >= 3
2896 0 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2897 0 : CYTHON_UNUSED_VAR(typ);
2898 0 : if (!self)
2899 0 : return __Pyx_NewRef(func);
2900 0 : return PyMethod_New(func, self);
2901 : }
2902 : #else
2903 : #define __Pyx_PyMethod_New PyMethod_New
2904 : #endif
2905 :
2906 : /* PyVectorcallFastCallDict.proto */
2907 : #if CYTHON_METH_FASTCALL
2908 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2909 : #endif
2910 :
2911 : /* CythonFunctionShared.proto */
2912 : #define __Pyx_CyFunction_USED
2913 : #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2914 : #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2915 : #define __Pyx_CYFUNCTION_CCLASS 0x04
2916 : #define __Pyx_CYFUNCTION_COROUTINE 0x08
2917 : #define __Pyx_CyFunction_GetClosure(f)\
2918 : (((__pyx_CyFunctionObject *) (f))->func_closure)
2919 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2920 : #define __Pyx_CyFunction_GetClassObj(f)\
2921 : (((__pyx_CyFunctionObject *) (f))->func_classobj)
2922 : #else
2923 : #define __Pyx_CyFunction_GetClassObj(f)\
2924 : ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2925 : #endif
2926 : #define __Pyx_CyFunction_SetClassObj(f, classobj)\
2927 : __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
2928 : #define __Pyx_CyFunction_Defaults(type, f)\
2929 : ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2930 : #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2931 : ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2932 : typedef struct {
2933 : #if CYTHON_COMPILING_IN_LIMITED_API
2934 : PyObject_HEAD
2935 : PyObject *func;
2936 : #elif PY_VERSION_HEX < 0x030900B1
2937 : PyCFunctionObject func;
2938 : #else
2939 : PyCMethodObject func;
2940 : #endif
2941 : #if CYTHON_BACKPORT_VECTORCALL
2942 : __pyx_vectorcallfunc func_vectorcall;
2943 : #endif
2944 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
2945 : PyObject *func_weakreflist;
2946 : #endif
2947 : PyObject *func_dict;
2948 : PyObject *func_name;
2949 : PyObject *func_qualname;
2950 : PyObject *func_doc;
2951 : PyObject *func_globals;
2952 : PyObject *func_code;
2953 : PyObject *func_closure;
2954 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2955 : PyObject *func_classobj;
2956 : #endif
2957 : void *defaults;
2958 : int defaults_pyobjects;
2959 : size_t defaults_size;
2960 : int flags;
2961 : PyObject *defaults_tuple;
2962 : PyObject *defaults_kwdict;
2963 : PyObject *(*defaults_getter)(PyObject *);
2964 : PyObject *func_annotations;
2965 : PyObject *func_is_coroutine;
2966 : } __pyx_CyFunctionObject;
2967 : #undef __Pyx_CyOrPyCFunction_Check
2968 : #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
2969 : #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
2970 : #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
2971 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
2972 : #undef __Pyx_IsSameCFunction
2973 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2974 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2975 : int flags, PyObject* qualname,
2976 : PyObject *closure,
2977 : PyObject *module, PyObject *globals,
2978 : PyObject* code);
2979 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2980 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2981 : size_t size,
2982 : int pyobjects);
2983 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2984 : PyObject *tuple);
2985 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2986 : PyObject *dict);
2987 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2988 : PyObject *dict);
2989 : static int __pyx_CyFunction_init(PyObject *module);
2990 : #if CYTHON_METH_FASTCALL
2991 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2992 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2993 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2994 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2995 : #if CYTHON_BACKPORT_VECTORCALL
2996 : #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
2997 : #else
2998 : #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2999 : #endif
3000 : #endif
3001 :
3002 : /* CythonFunction.proto */
3003 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
3004 : int flags, PyObject* qualname,
3005 : PyObject *closure,
3006 : PyObject *module, PyObject *globals,
3007 : PyObject* code);
3008 :
3009 : /* FusedFunction.proto */
3010 : typedef struct {
3011 : __pyx_CyFunctionObject func;
3012 : PyObject *__signatures__;
3013 : PyObject *self;
3014 : } __pyx_FusedFunctionObject;
3015 : static PyObject *__pyx_FusedFunction_New(PyMethodDef *ml, int flags,
3016 : PyObject *qualname, PyObject *closure,
3017 : PyObject *module, PyObject *globals,
3018 : PyObject *code);
3019 : static int __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self);
3020 : static int __pyx_FusedFunction_init(PyObject *module);
3021 : #define __Pyx_FusedFunction_USED
3022 :
3023 : /* CLineInTraceback.proto */
3024 : #ifdef CYTHON_CLINE_IN_TRACEBACK
3025 : #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
3026 : #else
3027 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
3028 : #endif
3029 :
3030 : /* CodeObjectCache.proto */
3031 : #if !CYTHON_COMPILING_IN_LIMITED_API
3032 : typedef struct {
3033 : PyCodeObject* code_object;
3034 : int code_line;
3035 : } __Pyx_CodeObjectCacheEntry;
3036 : struct __Pyx_CodeObjectCache {
3037 : int count;
3038 : int max_count;
3039 : __Pyx_CodeObjectCacheEntry* entries;
3040 : };
3041 : static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
3042 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
3043 : static PyCodeObject *__pyx_find_code_object(int code_line);
3044 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
3045 : #endif
3046 :
3047 : /* AddTraceback.proto */
3048 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
3049 : int py_line, const char *filename);
3050 :
3051 : #if PY_MAJOR_VERSION < 3
3052 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
3053 : static void __Pyx_ReleaseBuffer(Py_buffer *view);
3054 : #else
3055 : #define __Pyx_GetBuffer PyObject_GetBuffer
3056 : #define __Pyx_ReleaseBuffer PyBuffer_Release
3057 : #endif
3058 :
3059 :
3060 : /* BufferStructDeclare.proto */
3061 : typedef struct {
3062 : Py_ssize_t shape, strides, suboffsets;
3063 : } __Pyx_Buf_DimInfo;
3064 : typedef struct {
3065 : size_t refcount;
3066 : Py_buffer pybuffer;
3067 : } __Pyx_Buffer;
3068 : typedef struct {
3069 : __Pyx_Buffer *rcbuffer;
3070 : char *data;
3071 : __Pyx_Buf_DimInfo diminfo[8];
3072 : } __Pyx_LocalBuf_ND;
3073 :
3074 : /* MemviewSliceIsContig.proto */
3075 : static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
3076 :
3077 : /* OverlappingSlices.proto */
3078 : static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
3079 : __Pyx_memviewslice *slice2,
3080 : int ndim, size_t itemsize);
3081 :
3082 : /* IsLittleEndian.proto */
3083 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
3084 :
3085 : /* BufferFormatCheck.proto */
3086 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
3087 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
3088 : __Pyx_BufFmt_StackElem* stack,
3089 : __Pyx_TypeInfo* type);
3090 :
3091 : /* TypeInfoCompare.proto */
3092 : static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
3093 :
3094 : /* MemviewSliceValidateAndInit.proto */
3095 : static int __Pyx_ValidateAndInit_memviewslice(
3096 : int *axes_specs,
3097 : int c_or_f_flag,
3098 : int buf_flags,
3099 : int ndim,
3100 : __Pyx_TypeInfo *dtype,
3101 : __Pyx_BufFmt_StackElem stack[],
3102 : __Pyx_memviewslice *memviewslice,
3103 : PyObject *original_obj);
3104 :
3105 : /* ObjectToMemviewSlice.proto */
3106 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32(PyObject *, int writable_flag);
3107 :
3108 : /* ObjectToMemviewSlice.proto */
3109 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int64(PyObject *, int writable_flag);
3110 :
3111 : /* ObjectToMemviewSlice.proto */
3112 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(PyObject *, int writable_flag);
3113 :
3114 : /* ObjectToMemviewSlice.proto */
3115 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(PyObject *, int writable_flag);
3116 :
3117 : /* ObjectToMemviewSlice.proto */
3118 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
3119 :
3120 : /* ObjectToMemviewSlice.proto */
3121 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag);
3122 :
3123 : /* ObjectToMemviewSlice.proto */
3124 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32__const__(PyObject *, int writable_flag);
3125 :
3126 : /* ObjectToMemviewSlice.proto */
3127 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *, int writable_flag);
3128 :
3129 : /* ObjectToMemviewSlice.proto */
3130 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp__const__(PyObject *, int writable_flag);
3131 :
3132 : /* ObjectToMemviewSlice.proto */
3133 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_npy_intp__const__(PyObject *, int writable_flag);
3134 :
3135 : /* ObjectToMemviewSlice.proto */
3136 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn_npy_intp__const__(PyObject *, int writable_flag);
3137 :
3138 : /* ObjectToMemviewSlice.proto */
3139 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(PyObject *, int writable_flag);
3140 :
3141 : /* ObjectToMemviewSlice.proto */
3142 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *, int writable_flag);
3143 :
3144 : /* PyUCS4InUnicode.proto */
3145 : static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 character);
3146 :
3147 : /* MemviewDtypeToObject.proto */
3148 : static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
3149 : static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
3150 :
3151 : /* MemviewDtypeToObject.proto */
3152 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn_npy_int32(const char *itemp);
3153 : static CYTHON_INLINE int __pyx_memview_set_nn_npy_int32(const char *itemp, PyObject *obj);
3154 :
3155 : /* MemviewDtypeToObject.proto */
3156 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn_npy_int64(const char *itemp);
3157 : static CYTHON_INLINE int __pyx_memview_set_nn_npy_int64(const char *itemp, PyObject *obj);
3158 :
3159 : /* MemviewDtypeToObject.proto */
3160 : static CYTHON_INLINE PyObject *__pyx_memview_get_double__const__(const char *itemp);
3161 :
3162 : /* ObjectToMemviewSlice.proto */
3163 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp(PyObject *, int writable_flag);
3164 :
3165 : /* MemviewDtypeToObject.proto */
3166 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn_npy_int32__const__(const char *itemp);
3167 :
3168 : /* CppExceptionConversion.proto */
3169 : #ifndef __Pyx_CppExn2PyErr
3170 : #include <new>
3171 : #include <typeinfo>
3172 : #include <stdexcept>
3173 : #include <ios>
3174 0 : static void __Pyx_CppExn2PyErr() {
3175 0 : try {
3176 0 : if (PyErr_Occurred())
3177 : ; // let the latest Python exn pass through and ignore the current one
3178 : else
3179 0 : throw;
3180 0 : } catch (const std::bad_alloc& exn) {
3181 0 : PyErr_SetString(PyExc_MemoryError, exn.what());
3182 0 : } catch (const std::bad_cast& exn) {
3183 0 : PyErr_SetString(PyExc_TypeError, exn.what());
3184 0 : } catch (const std::bad_typeid& exn) {
3185 0 : PyErr_SetString(PyExc_TypeError, exn.what());
3186 0 : } catch (const std::domain_error& exn) {
3187 0 : PyErr_SetString(PyExc_ValueError, exn.what());
3188 0 : } catch (const std::invalid_argument& exn) {
3189 0 : PyErr_SetString(PyExc_ValueError, exn.what());
3190 0 : } catch (const std::ios_base::failure& exn) {
3191 0 : PyErr_SetString(PyExc_IOError, exn.what());
3192 0 : } catch (const std::out_of_range& exn) {
3193 0 : PyErr_SetString(PyExc_IndexError, exn.what());
3194 0 : } catch (const std::overflow_error& exn) {
3195 0 : PyErr_SetString(PyExc_OverflowError, exn.what());
3196 0 : } catch (const std::range_error& exn) {
3197 0 : PyErr_SetString(PyExc_ArithmeticError, exn.what());
3198 0 : } catch (const std::underflow_error& exn) {
3199 0 : PyErr_SetString(PyExc_ArithmeticError, exn.what());
3200 0 : } catch (const std::exception& exn) {
3201 0 : PyErr_SetString(PyExc_RuntimeError, exn.what());
3202 0 : }
3203 0 : catch (...)
3204 : {
3205 0 : PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
3206 0 : }
3207 0 : }
3208 : #endif
3209 :
3210 : /* MemviewDtypeToObject.proto */
3211 : static CYTHON_INLINE PyObject *__pyx_memview_get_Py_ssize_t(const char *itemp);
3212 : static CYTHON_INLINE int __pyx_memview_set_Py_ssize_t(const char *itemp, PyObject *obj);
3213 :
3214 : /* RealImag.proto */
3215 : #if CYTHON_CCOMPLEX
3216 : #ifdef __cplusplus
3217 : #define __Pyx_CREAL(z) ((z).real())
3218 : #define __Pyx_CIMAG(z) ((z).imag())
3219 : #else
3220 : #define __Pyx_CREAL(z) (__real__(z))
3221 : #define __Pyx_CIMAG(z) (__imag__(z))
3222 : #endif
3223 : #else
3224 : #define __Pyx_CREAL(z) ((z).real)
3225 : #define __Pyx_CIMAG(z) ((z).imag)
3226 : #endif
3227 : #if defined(__cplusplus) && CYTHON_CCOMPLEX\
3228 : && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
3229 : #define __Pyx_SET_CREAL(z,x) ((z).real(x))
3230 : #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
3231 : #else
3232 : #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
3233 : #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
3234 : #endif
3235 :
3236 : /* Arithmetic.proto */
3237 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3238 : #define __Pyx_c_eq_float(a, b) ((a)==(b))
3239 : #define __Pyx_c_sum_float(a, b) ((a)+(b))
3240 : #define __Pyx_c_diff_float(a, b) ((a)-(b))
3241 : #define __Pyx_c_prod_float(a, b) ((a)*(b))
3242 : #define __Pyx_c_quot_float(a, b) ((a)/(b))
3243 : #define __Pyx_c_neg_float(a) (-(a))
3244 : #ifdef __cplusplus
3245 : #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
3246 : #define __Pyx_c_conj_float(z) (::std::conj(z))
3247 : #if 1
3248 : #define __Pyx_c_abs_float(z) (::std::abs(z))
3249 : #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
3250 : #endif
3251 : #else
3252 : #define __Pyx_c_is_zero_float(z) ((z)==0)
3253 : #define __Pyx_c_conj_float(z) (conjf(z))
3254 : #if 1
3255 : #define __Pyx_c_abs_float(z) (cabsf(z))
3256 : #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
3257 : #endif
3258 : #endif
3259 : #else
3260 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
3261 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
3262 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
3263 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
3264 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
3265 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
3266 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
3267 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
3268 : #if 1
3269 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
3270 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
3271 : #endif
3272 : #endif
3273 :
3274 : /* Arithmetic.proto */
3275 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3276 : #define __Pyx_c_eq_double(a, b) ((a)==(b))
3277 : #define __Pyx_c_sum_double(a, b) ((a)+(b))
3278 : #define __Pyx_c_diff_double(a, b) ((a)-(b))
3279 : #define __Pyx_c_prod_double(a, b) ((a)*(b))
3280 : #define __Pyx_c_quot_double(a, b) ((a)/(b))
3281 : #define __Pyx_c_neg_double(a) (-(a))
3282 : #ifdef __cplusplus
3283 : #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3284 : #define __Pyx_c_conj_double(z) (::std::conj(z))
3285 : #if 1
3286 : #define __Pyx_c_abs_double(z) (::std::abs(z))
3287 : #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3288 : #endif
3289 : #else
3290 : #define __Pyx_c_is_zero_double(z) ((z)==0)
3291 : #define __Pyx_c_conj_double(z) (conj(z))
3292 : #if 1
3293 : #define __Pyx_c_abs_double(z) (cabs(z))
3294 : #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3295 : #endif
3296 : #endif
3297 : #else
3298 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3299 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3300 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3301 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3302 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3303 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3304 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3305 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3306 : #if 1
3307 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3308 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3309 : #endif
3310 : #endif
3311 :
3312 : /* Arithmetic.proto */
3313 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3314 : #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3315 : #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3316 : #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3317 : #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3318 : #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3319 : #define __Pyx_c_neg_long__double(a) (-(a))
3320 : #ifdef __cplusplus
3321 : #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3322 : #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3323 : #if 1
3324 : #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3325 : #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3326 : #endif
3327 : #else
3328 : #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3329 : #define __Pyx_c_conj_long__double(z) (conjl(z))
3330 : #if 1
3331 : #define __Pyx_c_abs_long__double(z) (cabsl(z))
3332 : #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3333 : #endif
3334 : #endif
3335 : #else
3336 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3337 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3338 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3339 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3340 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3341 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3342 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3343 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3344 : #if 1
3345 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3346 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3347 : #endif
3348 : #endif
3349 :
3350 : /* MemviewSliceCopyTemplate.proto */
3351 : static __Pyx_memviewslice
3352 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3353 : const char *mode, int ndim,
3354 : size_t sizeof_dtype, int contig_flag,
3355 : int dtype_is_object);
3356 :
3357 : /* MemviewSliceInit.proto */
3358 : #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3359 : #define __Pyx_MEMVIEW_DIRECT 1
3360 : #define __Pyx_MEMVIEW_PTR 2
3361 : #define __Pyx_MEMVIEW_FULL 4
3362 : #define __Pyx_MEMVIEW_CONTIG 8
3363 : #define __Pyx_MEMVIEW_STRIDED 16
3364 : #define __Pyx_MEMVIEW_FOLLOW 32
3365 : #define __Pyx_IS_C_CONTIG 1
3366 : #define __Pyx_IS_F_CONTIG 2
3367 : static int __Pyx_init_memviewslice(
3368 : struct __pyx_memoryview_obj *memview,
3369 : int ndim,
3370 : __Pyx_memviewslice *memviewslice,
3371 : int memview_is_new_reference);
3372 : static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3373 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3374 : static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3375 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3376 : #define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3377 : #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3378 : #define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3379 : static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3380 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3381 :
3382 : /* CIntFromPy.proto */
3383 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3384 :
3385 : /* CIntToPy.proto */
3386 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3387 :
3388 : /* CIntFromPy.proto */
3389 : static CYTHON_INLINE npy_intp __Pyx_PyInt_As_npy_intp(PyObject *);
3390 :
3391 : /* CIntToPy.proto */
3392 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3393 :
3394 : /* CIntToPy.proto */
3395 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value);
3396 :
3397 : /* CIntFromPy.proto */
3398 : static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
3399 :
3400 : /* CIntToPy.proto */
3401 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value);
3402 :
3403 : /* CIntFromPy.proto */
3404 : static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
3405 :
3406 : /* CIntToPy.proto */
3407 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value);
3408 :
3409 : /* ImportNumPyArray.proto */
3410 : static PyObject *__pyx_numpy_ndarray = NULL;
3411 : static PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void);
3412 :
3413 : /* CIntFromPy.proto */
3414 : static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
3415 :
3416 : /* None.proto */
3417 : #include <new>
3418 :
3419 : /* CIntFromPy.proto */
3420 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3421 :
3422 : /* CIntFromPy.proto */
3423 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3424 :
3425 : /* FormatTypeName.proto */
3426 : #if CYTHON_COMPILING_IN_LIMITED_API
3427 : typedef PyObject *__Pyx_TypeName;
3428 : #define __Pyx_FMT_TYPENAME "%U"
3429 : static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
3430 : #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3431 : #else
3432 : typedef const char *__Pyx_TypeName;
3433 : #define __Pyx_FMT_TYPENAME "%.200s"
3434 : #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
3435 : #define __Pyx_DECREF_TypeName(obj)
3436 : #endif
3437 :
3438 : /* CheckBinaryVersion.proto */
3439 : static unsigned long __Pyx_get_runtime_version(void);
3440 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3441 :
3442 : /* InitStrings.proto */
3443 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3444 :
3445 : /* #### Code section: module_declarations ### */
3446 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3447 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3448 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3449 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3450 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3451 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3452 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3453 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3454 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3455 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3456 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3457 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3458 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
3459 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
3460 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
3461 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
3462 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
3463 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
3464 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3465 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3466 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3467 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3468 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3469 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3470 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
3471 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
3472 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
3473 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
3474 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
3475 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3476 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3477 :
3478 : /* Module declarations from "libc.string" */
3479 :
3480 : /* Module declarations from "libc.stdio" */
3481 :
3482 : /* Module declarations from "__builtin__" */
3483 :
3484 : /* Module declarations from "cpython.type" */
3485 :
3486 : /* Module declarations from "cpython" */
3487 :
3488 : /* Module declarations from "cpython.object" */
3489 :
3490 : /* Module declarations from "cpython.ref" */
3491 :
3492 : /* Module declarations from "numpy" */
3493 :
3494 : /* Module declarations from "numpy" */
3495 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
3496 :
3497 : /* Module declarations from "cython.view" */
3498 :
3499 : /* Module declarations from "cython.dataclasses" */
3500 :
3501 : /* Module declarations from "cython" */
3502 :
3503 : /* Module declarations from "libc.math" */
3504 :
3505 : /* Module declarations from "scipy.interpolate._bspl" */
3506 : static PyObject *__pyx_collections_abc_Sequence = 0;
3507 : static PyObject *generic = 0;
3508 : static PyObject *strided = 0;
3509 : static PyObject *indirect = 0;
3510 : static PyObject *contiguous = 0;
3511 : static PyObject *indirect_contiguous = 0;
3512 : static int __pyx_memoryview_thread_locks_used;
3513 : static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3514 : static CYTHON_INLINE int __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__Pyx_memviewslice, int, double, int, int); /*proto*/
3515 : static CYTHON_INLINE PyObject *__Pyx_carray_to_py_Py_ssize_t(Py_ssize_t *, Py_ssize_t); /*proto*/
3516 : static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_Py_ssize_t(Py_ssize_t *, Py_ssize_t); /*proto*/
3517 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3518 : static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3519 : static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3520 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3521 : static PyObject *_unellipsify(PyObject *, int); /*proto*/
3522 : static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3523 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3524 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
3525 : static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3526 : static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3527 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3528 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3529 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3530 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3531 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3532 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3533 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3534 : static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3535 : static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3536 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3537 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3538 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3539 : static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3540 : static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
3541 : static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
3542 : static int __pyx_memoryview_err_no_memory(void); /*proto*/
3543 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3544 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3545 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3546 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3547 : static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3548 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3549 : static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3550 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3551 : /* #### Code section: typeinfo ### */
3552 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int32 = { "npy_int32", NULL, sizeof(npy_int32), { 0 }, 0, __PYX_IS_UNSIGNED(npy_int32) ? 'U' : 'I', __PYX_IS_UNSIGNED(npy_int32), 0 };
3553 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int64 = { "npy_int64", NULL, sizeof(npy_int64), { 0 }, 0, __PYX_IS_UNSIGNED(npy_int64) ? 'U' : 'I', __PYX_IS_UNSIGNED(npy_int64), 0 };
3554 : static __Pyx_TypeInfo __Pyx_TypeInfo_double__const__ = { "const double", NULL, sizeof(double const ), { 0 }, 0, 'R', 0, 0 };
3555 : static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
3556 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_int32__const__ = { "const npy_int32", NULL, sizeof(npy_int32 const ), { 0 }, 0, __PYX_IS_UNSIGNED(npy_int32 const ) ? 'U' : 'I', __PYX_IS_UNSIGNED(npy_int32 const ), 0 };
3557 : static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, __PYX_IS_UNSIGNED(int) ? 'U' : 'I', __PYX_IS_UNSIGNED(int), 0 };
3558 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_intp__const__ = { "const npy_intp", NULL, sizeof(npy_intp const ), { 0 }, 0, __PYX_IS_UNSIGNED(npy_intp const ) ? 'U' : 'I', __PYX_IS_UNSIGNED(npy_intp const ), 0 };
3559 : static __Pyx_TypeInfo __Pyx_TypeInfo_Py_ssize_t = { "Py_ssize_t", NULL, sizeof(Py_ssize_t), { 0 }, 0, __PYX_IS_UNSIGNED(Py_ssize_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(Py_ssize_t), 0 };
3560 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn_npy_intp = { "npy_intp", NULL, sizeof(npy_intp), { 0 }, 0, __PYX_IS_UNSIGNED(npy_intp) ? 'U' : 'I', __PYX_IS_UNSIGNED(npy_intp), 0 };
3561 : /* #### Code section: before_global_var ### */
3562 : #define __Pyx_MODULE_NAME "scipy.interpolate._bspl"
3563 : extern int __pyx_module_is_main_scipy__interpolate___bspl;
3564 : int __pyx_module_is_main_scipy__interpolate___bspl = 0;
3565 :
3566 : /* Implementation of "scipy.interpolate._bspl" */
3567 : /* #### Code section: global_var ### */
3568 : static PyObject *__pyx_builtin_ValueError;
3569 : static PyObject *__pyx_builtin_NotImplementedError;
3570 : static PyObject *__pyx_builtin_range;
3571 : static PyObject *__pyx_builtin_TypeError;
3572 : static PyObject *__pyx_builtin_max;
3573 : static PyObject *__pyx_builtin___import__;
3574 : static PyObject *__pyx_builtin_MemoryError;
3575 : static PyObject *__pyx_builtin_enumerate;
3576 : static PyObject *__pyx_builtin_AssertionError;
3577 : static PyObject *__pyx_builtin_Ellipsis;
3578 : static PyObject *__pyx_builtin_id;
3579 : static PyObject *__pyx_builtin_IndexError;
3580 : static PyObject *__pyx_builtin_ImportError;
3581 : /* #### Code section: string_decls ### */
3582 : static const char __pyx_k_[] = ": ";
3583 : static const char __pyx_k_A[] = "A";
3584 : static const char __pyx_k_O[] = "O";
3585 : static const char __pyx_k_R[] = "R";
3586 : static const char __pyx_k_a[] = "a";
3587 : static const char __pyx_k_b[] = "b";
3588 : static const char __pyx_k_c[] = "c";
3589 : static const char __pyx_k_d[] = "d";
3590 : static const char __pyx_k_i[] = "i";
3591 : static const char __pyx_k_j[] = "j";
3592 : static const char __pyx_k_k[] = "k";
3593 : static const char __pyx_k_m[] = "m";
3594 : static const char __pyx_k_n[] = "n";
3595 : static const char __pyx_k_r[] = "r";
3596 : static const char __pyx_k_s[] = "s";
3597 : static const char __pyx_k_t[] = "t";
3598 : static const char __pyx_k_w[] = "w";
3599 : static const char __pyx_k_x[] = "x";
3600 : static const char __pyx_k_y[] = "y";
3601 : static const char __pyx_k__2[] = ".";
3602 : static const char __pyx_k__3[] = "*";
3603 : static const char __pyx_k__6[] = "'";
3604 : static const char __pyx_k__7[] = ")";
3605 : static const char __pyx_k_ab[] = "ab";
3606 : static const char __pyx_k_ci[] = "ci";
3607 : static const char __pyx_k_gc[] = "gc";
3608 : static const char __pyx_k_id[] = "id";
3609 : static const char __pyx_k_ip[] = "ip";
3610 : static const char __pyx_k_jp[] = "jp";
3611 : static const char __pyx_k_kd[] = "kd";
3612 : static const char __pyx_k_kl[] = "kl";
3613 : static const char __pyx_k_ku[] = "ku";
3614 : static const char __pyx_k_nc[] = "nc";
3615 : static const char __pyx_k_np[] = "np";
3616 : static const char __pyx_k_nu[] = "nu";
3617 : static const char __pyx_k_nz[] = "nz";
3618 : static const char __pyx_k_td[] = "td";
3619 : static const char __pyx_k_xd[] = "xd";
3620 : static const char __pyx_k_xi[] = "xi";
3621 : static const char __pyx_k_xp[] = "xp";
3622 : static const char __pyx_k_xv[] = "xv";
3623 : static const char __pyx_k__13[] = "()";
3624 : static const char __pyx_k__14[] = "|";
3625 : static const char __pyx_k__52[] = "?";
3626 : static const char __pyx_k_abc[] = "abc";
3627 : static const char __pyx_k_and[] = " and ";
3628 : static const char __pyx_k_bbb[] = "bbb";
3629 : static const char __pyx_k_c1r[] = "c1r";
3630 : static const char __pyx_k_get[] = "get";
3631 : static const char __pyx_k_got[] = " (got ";
3632 : static const char __pyx_k_i_c[] = "i_c";
3633 : static const char __pyx_k_idx[] = "idx";
3634 : static const char __pyx_k_ind[] = "ind";
3635 : static const char __pyx_k_m_2[] = " != m =";
3636 : static const char __pyx_k_m_3[] = " > m = ";
3637 : static const char __pyx_k_max[] = "max";
3638 : static const char __pyx_k_new[] = "__new__";
3639 : static const char __pyx_k_obj[] = "obj";
3640 : static const char __pyx_k_out[] = "out";
3641 : static const char __pyx_k_rhs[] = "rhs";
3642 : static const char __pyx_k_row[] = "row";
3643 : static const char __pyx_k_sys[] = "sys";
3644 : static const char __pyx_k_t_2[] = "_t";
3645 : static const char __pyx_k_wrk[] = "wrk";
3646 : static const char __pyx_k_args[] = "args";
3647 : static const char __pyx_k_base[] = "base";
3648 : static const char __pyx_k_clmn[] = "clmn";
3649 : static const char __pyx_k_data[] = "data";
3650 : static const char __pyx_k_dict[] = "__dict__";
3651 : static const char __pyx_k_intp[] = "intp";
3652 : static const char __pyx_k_kind[] = "kind";
3653 : static const char __pyx_k_left[] = "left";
3654 : static const char __pyx_k_main[] = "__main__";
3655 : static const char __pyx_k_mode[] = "mode";
3656 : static const char __pyx_k_name[] = "name";
3657 : static const char __pyx_k_nc_2[] = "nc = ";
3658 : static const char __pyx_k_ndim[] = "ndim";
3659 : static const char __pyx_k_ones[] = "ones";
3660 : static const char __pyx_k_pack[] = "pack";
3661 : static const char __pyx_k_size[] = "size";
3662 : static const char __pyx_k_spec[] = "__spec__";
3663 : static const char __pyx_k_step[] = "step";
3664 : static const char __pyx_k_stop[] = "stop";
3665 : static const char __pyx_k_test[] = "__test__";
3666 : static const char __pyx_k_work[] = "work";
3667 : static const char __pyx_k_wval[] = "wval";
3668 : static const char __pyx_k_xval[] = "xval";
3669 : static const char __pyx_k_ASCII[] = "ASCII";
3670 : static const char __pyx_k_class[] = "__class__";
3671 : static const char __pyx_k_count[] = "count";
3672 : static const char __pyx_k_dtype[] = "dtype";
3673 : static const char __pyx_k_empty[] = "empty";
3674 : static const char __pyx_k_error[] = "error";
3675 : static const char __pyx_k_flags[] = "flags";
3676 : static const char __pyx_k_idx_b[] = "idx_b";
3677 : static const char __pyx_k_idx_c[] = "idx_c";
3678 : static const char __pyx_k_iflat[] = "iflat";
3679 : static const char __pyx_k_index[] = "index";
3680 : static const char __pyx_k_int64[] = "int64";
3681 : static const char __pyx_k_len_t[] = "len_t";
3682 : static const char __pyx_k_len_w[] = "len(w) =";
3683 : static const char __pyx_k_len_x[] = " != len(x) =";
3684 : static const char __pyx_k_numpy[] = "numpy";
3685 : static const char __pyx_k_range[] = "range";
3686 : static const char __pyx_k_shape[] = "shape";
3687 : static const char __pyx_k_split[] = "split";
3688 : static const char __pyx_k_start[] = "start";
3689 : static const char __pyx_k_strip[] = "strip";
3690 : static const char __pyx_k_xvals[] = "xvals";
3691 : static const char __pyx_k_zeros[] = "zeros";
3692 : static const char __pyx_k_arange[] = "arange";
3693 : static const char __pyx_k_colloc[] = "_colloc";
3694 : static const char __pyx_k_enable[] = "enable";
3695 : static const char __pyx_k_encode[] = "encode";
3696 : static const char __pyx_k_factor[] = "factor";
3697 : static const char __pyx_k_format[] = "format";
3698 : static const char __pyx_k_fpback[] = "_fpback";
3699 : static const char __pyx_k_fpknot[] = "_fpknot";
3700 : static const char __pyx_k_import[] = "__import__";
3701 : static const char __pyx_k_kwargs[] = "kwargs";
3702 : static const char __pyx_k_name_2[] = "__name__";
3703 : static const char __pyx_k_offset[] = "offset";
3704 : static const char __pyx_k_pickle[] = "pickle";
3705 : static const char __pyx_k_prev_l[] = "prev_l";
3706 : static const char __pyx_k_reduce[] = "__reduce__";
3707 : static const char __pyx_k_struct[] = "struct";
3708 : static const char __pyx_k_unpack[] = "unpack";
3709 : static const char __pyx_k_update[] = "update";
3710 : static const char __pyx_k_values[] = "values";
3711 : static const char __pyx_k_volume[] = "volume";
3712 : static const char __pyx_k_asarray[] = "asarray";
3713 : static const char __pyx_k_disable[] = "disable";
3714 : static const char __pyx_k_float64[] = "float64";
3715 : static const char __pyx_k_fortran[] = "fortran";
3716 : static const char __pyx_k_indices[] = "indices";
3717 : static const char __pyx_k_len_x_2[] = "len(x) = ";
3718 : static const char __pyx_k_memview[] = "memview";
3719 : static const char __pyx_k_with_xv[] = ", with xv = ";
3720 : static const char __pyx_k_y_shape[] = "y.shape = ";
3721 : static const char __pyx_k_D_points[] = "-D points.";
3722 : static const char __pyx_k_Ellipsis[] = "Ellipsis";
3723 : static const char __pyx_k_Sequence[] = "Sequence";
3724 : static const char __pyx_k_csr_data[] = "csr_data";
3725 : static const char __pyx_k_cstrides[] = "_cstrides";
3726 : static const char __pyx_k_defaults[] = "defaults";
3727 : static const char __pyx_k_getstate[] = "__getstate__";
3728 : static const char __pyx_k_interval[] = "interval";
3729 : static const char __pyx_k_itemsize[] = "itemsize";
3730 : static const char __pyx_k_num_c_tr[] = "num_c_tr";
3731 : static const char __pyx_k_pyx_type[] = "__pyx_type";
3732 : static const char __pyx_k_register[] = "register";
3733 : static const char __pyx_k_setstate[] = "__setstate__";
3734 : static const char __pyx_k_startrow[] = "startrow";
3735 : static const char __pyx_k_TypeError[] = "TypeError";
3736 : static const char __pyx_k_colloc_nd[] = "_colloc_nd";
3737 : static const char __pyx_k_enumerate[] = "enumerate";
3738 : static const char __pyx_k_idx_cflat[] = "idx_cflat";
3739 : static const char __pyx_k_isenabled[] = "isenabled";
3740 : static const char __pyx_k_npy_int32[] = "npy_int32";
3741 : static const char __pyx_k_npy_int64[] = "npy_int64";
3742 : static const char __pyx_k_pyx_state[] = "__pyx_state";
3743 : static const char __pyx_k_qr_reduce[] = "_qr_reduce";
3744 : static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3745 : static const char __pyx_k_residuals[] = "residuals";
3746 : static const char __pyx_k_IndexError[] = "IndexError";
3747 : static const char __pyx_k_ValueError[] = "ValueError";
3748 : static const char __pyx_k_csr_indptr[] = "csr_indptr";
3749 : static const char __pyx_k_empty_like[] = "empty_like";
3750 : static const char __pyx_k_pyx_result[] = "__pyx_result";
3751 : static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3752 : static const char __pyx_k_signatures[] = "signatures";
3753 : static const char __pyx_k_strides_c1[] = "strides_c1";
3754 : static const char __pyx_k_D_space_got[] = "-D space, got ";
3755 : static const char __pyx_k_ImportError[] = "ImportError";
3756 : static const char __pyx_k_MemoryError[] = "MemoryError";
3757 : static const char __pyx_k_PickleError[] = "PickleError";
3758 : static const char __pyx_k_collections[] = "collections";
3759 : static const char __pyx_k_csr_indices[] = "csr_indices";
3760 : static const char __pyx_k_data_matrix[] = "_data_matrix";
3761 : static const char __pyx_k_extrapolate[] = "extrapolate";
3762 : static const char __pyx_k_indices_k1d[] = "indices_k1d";
3763 : static const char __pyx_k_norm_eq_lsq[] = "_norm_eq_lsq";
3764 : static const char __pyx_k_initializing[] = "_initializing";
3765 : static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3766 : static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
3767 : static const char __pyx_k_stringsource[] = "<stringsource>";
3768 : static const char __pyx_k_version_info[] = "version_info";
3769 : static const char __pyx_k_class_getitem[] = "__class_getitem__";
3770 : static const char __pyx_k_indices_k1d_2[] = "_indices_k1d";
3771 : static const char __pyx_k_len_residuals[] = " != len(residuals) =";
3772 : static const char __pyx_k_out_of_bounds[] = "out_of_bounds";
3773 : static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3774 : static const char __pyx_k_AssertionError[] = "AssertionError";
3775 : static const char __pyx_k_fused_sigindex[] = "_fused_sigindex";
3776 : static const char __pyx_k_idx_cflat_base[] = "idx_cflat_base";
3777 : static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
3778 : static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3779 : static const char __pyx_k_and_out_shape_1[] = " and out.shape[1] = ";
3780 : static const char __pyx_k_collections_abc[] = "collections.abc";
3781 : static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3782 : static const char __pyx_k_evaluate_spline[] = "evaluate_spline";
3783 : static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3784 : static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3785 : static const char __pyx_k_py_find_interval[] = "_py_find_interval";
3786 : static const char __pyx_k_evaluate_all_bspl[] = "evaluate_all_bspl";
3787 : static const char __pyx_k_output_values_got[] = " output values, got ";
3788 : static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3789 : static const char __pyx_k_Out_of_bounds_in_d[] = "Out of bounds in d = ";
3790 : static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3791 : static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3792 : static const char __pyx_k_evaluate_ndbspline[] = "evaluate_ndbspline";
3793 : static const char __pyx_k_make_design_matrix[] = "_make_design_matrix";
3794 : static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3795 : static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
3796 : static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3797 : static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
3798 : static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3799 : static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
3800 : static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3801 : static const char __pyx_k_Expacted_data_points_in[] = "Expacted data points in ";
3802 : static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3803 : static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3804 : static const char __pyx_k_scipy_interpolate__bspl[] = "scipy.interpolate._bspl";
3805 : static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3806 : static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
3807 : static const char __pyx_k_evaluate_all_bspl_line_181[] = "evaluate_all_bspl (line 181)";
3808 : static const char __pyx_k_No_matching_signature_found[] = "No matching signature found";
3809 : static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
3810 : static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3811 : static const char __pyx_k_Cannot_do_derivative_order_s[] = "Cannot do derivative order %s.";
3812 : static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3813 : static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3814 : static const char __pyx_k_Routines_for_evaluating_and_man[] = "\nRoutines for evaluating and manipulating B-splines.\n\n";
3815 : static const char __pyx_k_home_czgdp18079_Quansight_scipy[] = "/home/czgdp18079/Quansight/scipy/scipy/interpolate/_bspl.pyx";
3816 : static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
3817 : static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3818 : static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3819 : static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3820 : static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3821 : static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3822 : static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3823 : static const char __pyx_k_Evaluate_the_k_1_B_splines_which[] = "Evaluate the ``k+1`` B-splines which are non-zero on interval ``m``.\n\n Parameters\n ----------\n t : ndarray, shape (nt + k + 1,)\n sorted 1D array of knots\n k : int\n spline order\n xval: float\n argument at which to evaluate the B-splines\n m : int\n index of the left edge of the evaluation interval, ``t[m] <= x < t[m+1]``\n nu : int, optional\n Evaluate derivatives order `nu`. Default is zero.\n\n Returns\n -------\n ndarray, shape (k+1,)\n The values of B-splines :math:`[B_{m-k}(xval), ..., B_{m}(xval)]` if\n `nu` is zero, otherwise the derivatives of order `nu`.\n\n Examples\n --------\n\n A textbook use of this sort of routine is plotting the ``k+1`` polynomial\n pieces which make up a B-spline of order `k`.\n\n Consider a cubic spline\n\n >>> k = 3\n >>> t = [0., 1., 2., 3., 4.] # internal knots\n >>> a, b = t[0], t[-1] # base interval is [a, b)\n >>> t = np.array([a]*k + t + [b]*k) # add boundary knots\n\n >>> import matplotlib.pyplot as plt\n >>> xx = np.linspace(a, b, 100)\n >>> plt.plot(xx, BSpline.basis_element(t[k:-k])(xx),\n ... lw=3, alpha=0.5, label='basis_element')\n\n Now we use slide an interval ``t[m]..t[m+1]`` along the base interval\n ``a..b`` and use `evaluate_all_bspl` to compute the restriction of\n the B-spline of interest to this interval:\n\n >>> for i in range(k+1):\n ... x1, x2 = t[2*k - i], t[2*k - i + 1]\n ... xx = np.linspace(x1 - 0.5, x2 + 0.5)\n ... yy = [evaluate_all_bspl(t, k, x, 2*k - i)[i] for x in xx]\n ... plt.plot(xx, yy, '--', label=str(i))\n ...\n >>> plt.grid(True)\n >>> plt.legend()\n >>> plt.show()\n\n ";
3824 : static const char __pyx_k_Expected_at_least_d_argument_s_g[] = "Expected at least %d argument%s, got %d";
3825 : static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types";
3826 : static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
3827 : static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3828 : static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
3829 : static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
3830 : static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3831 : static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
3832 : static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3833 : static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
3834 : static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
3835 : static const char __pyx_k_out_and_c_are_inconsistent_num_c[] = "out and c are inconsistent: num_c=";
3836 : static const char __pyx_k_out_and_c_have_incompatible_shap[] = "out and c have incompatible shapes";
3837 : static const char __pyx_k_out_and_xi_are_inconsistent_expe[] = "out and xi are inconsistent: expected ";
3838 : static const char __pyx_k_out_and_xp_have_incompatible_sha[] = "out and xp have incompatible shapes";
3839 : static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3840 : /* #### Code section: decls ### */
3841 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3842 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3843 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3844 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3845 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3846 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3847 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3848 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3849 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3850 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3851 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3852 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3853 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3854 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3855 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3856 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3857 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3858 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3859 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3860 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3861 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3862 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3863 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3864 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3865 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3866 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3867 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3868 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3869 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3870 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3871 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3872 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3873 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3874 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3875 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3876 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3877 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3878 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3879 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3880 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3881 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3882 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl__py_find_interval(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, double __pyx_v_xval, int __pyx_v_prev_l, int __pyx_v_extrapolate); /* proto */
3883 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_2evaluate_spline(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_c, int __pyx_v_k, __Pyx_memviewslice __pyx_v_xp, int __pyx_v_nu, int __pyx_v_extrapolate, __Pyx_memviewslice __pyx_v_out); /* proto */
3884 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_4evaluate_all_bspl(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, double __pyx_v_xval, int __pyx_v_m, int __pyx_v_nu); /* proto */
3885 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_6_colloc(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, __Pyx_memviewslice __pyx_v_ab, int __pyx_v_offset); /* proto */
3886 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_8_norm_eq_lsq(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_w, __Pyx_memviewslice __pyx_v_ab, __Pyx_memviewslice __pyx_v_rhs); /* proto */
3887 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_10_make_design_matrix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults, PyObject *__pyx_v__fused_sigindex); /* proto */
3888 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_24_make_design_matrix(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, int __pyx_v_extrapolate, __Pyx_memviewslice __pyx_v_indices); /* proto */
3889 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_26_make_design_matrix(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, int __pyx_v_extrapolate, __Pyx_memviewslice __pyx_v_indices); /* proto */
3890 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_12evaluate_ndbspline(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_xi, __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_len_t, __Pyx_memviewslice __pyx_v_k, __Pyx_memviewslice __pyx_v_nu, int __pyx_v_extrapolate, __Pyx_memviewslice __pyx_v_c1r, npy_intp __pyx_v_num_c_tr, __Pyx_memviewslice __pyx_v_strides_c1, __Pyx_memviewslice __pyx_v_indices_k1d, __Pyx_memviewslice __pyx_v_out); /* proto */
3891 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_14_colloc_nd(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_xvals, __Pyx_memviewslice __pyx_v__t, __Pyx_memviewslice __pyx_v_len_t, __Pyx_memviewslice __pyx_v_k, __Pyx_memviewslice __pyx_v__indices_k1d, __Pyx_memviewslice __pyx_v__cstrides); /* proto */
3892 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_16_qr_reduce(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_offset, Py_ssize_t __pyx_v_nc, __Pyx_memviewslice __pyx_v_y, Py_ssize_t __pyx_v_startrow); /* proto */
3893 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_18_data_matrix(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, __Pyx_memviewslice __pyx_v_w); /* proto */
3894 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_20_fpback(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_R, Py_ssize_t __pyx_v_nc, __Pyx_memviewslice __pyx_v_y); /* proto */
3895 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_22_fpknot(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, __Pyx_memviewslice __pyx_v_residuals); /* proto */
3896 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3897 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3898 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3899 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3900 : static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
3901 : static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values = {0, 0, 0, 0, 0};
3902 : /* #### Code section: late_includes ### */
3903 : /* #### Code section: module_state ### */
3904 : typedef struct {
3905 : PyObject *__pyx_d;
3906 : PyObject *__pyx_b;
3907 : PyObject *__pyx_cython_runtime;
3908 : PyObject *__pyx_empty_tuple;
3909 : PyObject *__pyx_empty_bytes;
3910 : PyObject *__pyx_empty_unicode;
3911 : #ifdef __Pyx_CyFunction_USED
3912 : PyTypeObject *__pyx_CyFunctionType;
3913 : #endif
3914 : #ifdef __Pyx_FusedFunction_USED
3915 : PyTypeObject *__pyx_FusedFunctionType;
3916 : #endif
3917 : #ifdef __Pyx_Generator_USED
3918 : PyTypeObject *__pyx_GeneratorType;
3919 : #endif
3920 : #ifdef __Pyx_IterableCoroutine_USED
3921 : PyTypeObject *__pyx_IterableCoroutineType;
3922 : #endif
3923 : #ifdef __Pyx_Coroutine_USED
3924 : PyTypeObject *__pyx_CoroutineAwaitType;
3925 : #endif
3926 : #ifdef __Pyx_Coroutine_USED
3927 : PyTypeObject *__pyx_CoroutineType;
3928 : #endif
3929 : #if CYTHON_USE_MODULE_STATE
3930 : #endif
3931 : #if CYTHON_USE_MODULE_STATE
3932 : #endif
3933 : #if CYTHON_USE_MODULE_STATE
3934 : #endif
3935 : #if CYTHON_USE_MODULE_STATE
3936 : #endif
3937 : PyTypeObject *__pyx_ptype_7cpython_4type_type;
3938 : #if CYTHON_USE_MODULE_STATE
3939 : #endif
3940 : #if CYTHON_USE_MODULE_STATE
3941 : #endif
3942 : #if CYTHON_USE_MODULE_STATE
3943 : #endif
3944 : #if CYTHON_USE_MODULE_STATE
3945 : #endif
3946 : #if CYTHON_USE_MODULE_STATE
3947 : #endif
3948 : PyTypeObject *__pyx_ptype_5numpy_dtype;
3949 : PyTypeObject *__pyx_ptype_5numpy_flatiter;
3950 : PyTypeObject *__pyx_ptype_5numpy_broadcast;
3951 : PyTypeObject *__pyx_ptype_5numpy_ndarray;
3952 : PyTypeObject *__pyx_ptype_5numpy_generic;
3953 : PyTypeObject *__pyx_ptype_5numpy_number;
3954 : PyTypeObject *__pyx_ptype_5numpy_integer;
3955 : PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3956 : PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3957 : PyTypeObject *__pyx_ptype_5numpy_inexact;
3958 : PyTypeObject *__pyx_ptype_5numpy_floating;
3959 : PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3960 : PyTypeObject *__pyx_ptype_5numpy_flexible;
3961 : PyTypeObject *__pyx_ptype_5numpy_character;
3962 : PyTypeObject *__pyx_ptype_5numpy_ufunc;
3963 : #if CYTHON_USE_MODULE_STATE
3964 : #endif
3965 : #if CYTHON_USE_MODULE_STATE
3966 : #endif
3967 : #if CYTHON_USE_MODULE_STATE
3968 : #endif
3969 : #if CYTHON_USE_MODULE_STATE
3970 : #endif
3971 : #if CYTHON_USE_MODULE_STATE
3972 : PyObject *__pyx_type___pyx_array;
3973 : PyObject *__pyx_type___pyx_MemviewEnum;
3974 : PyObject *__pyx_type___pyx_memoryview;
3975 : PyObject *__pyx_type___pyx_memoryviewslice;
3976 : #endif
3977 : PyTypeObject *__pyx_array_type;
3978 : PyTypeObject *__pyx_MemviewEnum_type;
3979 : PyTypeObject *__pyx_memoryview_type;
3980 : PyTypeObject *__pyx_memoryviewslice_type;
3981 : PyObject *__pyx_kp_u_;
3982 : PyObject *__pyx_n_s_A;
3983 : PyObject *__pyx_n_s_ASCII;
3984 : PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
3985 : PyObject *__pyx_n_s_AssertionError;
3986 : PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3987 : PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3988 : PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3989 : PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3990 : PyObject *__pyx_kp_u_Cannot_do_derivative_order_s;
3991 : PyObject *__pyx_kp_u_Cannot_index_with_type;
3992 : PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
3993 : PyObject *__pyx_kp_u_D_points;
3994 : PyObject *__pyx_kp_u_D_space_got;
3995 : PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
3996 : PyObject *__pyx_n_s_Ellipsis;
3997 : PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3998 : PyObject *__pyx_kp_u_Evaluate_the_k_1_B_splines_which;
3999 : PyObject *__pyx_kp_u_Expacted_data_points_in;
4000 : PyObject *__pyx_kp_s_Expected_at_least_d_argument_s_g;
4001 : PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg;
4002 : PyObject *__pyx_n_s_ImportError;
4003 : PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
4004 : PyObject *__pyx_n_s_IndexError;
4005 : PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
4006 : PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
4007 : PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
4008 : PyObject *__pyx_kp_u_Invalid_shape_in_axis;
4009 : PyObject *__pyx_n_s_MemoryError;
4010 : PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
4011 : PyObject *__pyx_kp_s_MemoryView_of_r_object;
4012 : PyObject *__pyx_kp_s_No_matching_signature_found;
4013 : PyObject *__pyx_n_s_NotImplementedError;
4014 : PyObject *__pyx_n_b_O;
4015 : PyObject *__pyx_kp_u_Out_of_bounds_in_d;
4016 : PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
4017 : PyObject *__pyx_n_s_PickleError;
4018 : PyObject *__pyx_n_s_R;
4019 : PyObject *__pyx_n_s_Sequence;
4020 : PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
4021 : PyObject *__pyx_n_s_TypeError;
4022 : PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
4023 : PyObject *__pyx_n_s_ValueError;
4024 : PyObject *__pyx_n_s_View_MemoryView;
4025 : PyObject *__pyx_kp_s__13;
4026 : PyObject *__pyx_kp_s__14;
4027 : PyObject *__pyx_kp_u__14;
4028 : PyObject *__pyx_kp_u__2;
4029 : PyObject *__pyx_n_s__3;
4030 : PyObject *__pyx_n_s__52;
4031 : PyObject *__pyx_kp_u__6;
4032 : PyObject *__pyx_kp_u__7;
4033 : PyObject *__pyx_n_s_a;
4034 : PyObject *__pyx_n_s_ab;
4035 : PyObject *__pyx_n_s_abc;
4036 : PyObject *__pyx_n_s_allocate_buffer;
4037 : PyObject *__pyx_kp_u_and;
4038 : PyObject *__pyx_kp_u_and_out_shape_1;
4039 : PyObject *__pyx_n_s_arange;
4040 : PyObject *__pyx_n_s_args;
4041 : PyObject *__pyx_n_s_asarray;
4042 : PyObject *__pyx_n_s_asyncio_coroutines;
4043 : PyObject *__pyx_n_s_b;
4044 : PyObject *__pyx_n_s_base;
4045 : PyObject *__pyx_n_s_bbb;
4046 : PyObject *__pyx_n_s_c;
4047 : PyObject *__pyx_n_u_c;
4048 : PyObject *__pyx_n_s_c1r;
4049 : PyObject *__pyx_n_s_ci;
4050 : PyObject *__pyx_n_s_class;
4051 : PyObject *__pyx_n_s_class_getitem;
4052 : PyObject *__pyx_n_s_cline_in_traceback;
4053 : PyObject *__pyx_n_s_clmn;
4054 : PyObject *__pyx_n_s_collections;
4055 : PyObject *__pyx_kp_s_collections_abc;
4056 : PyObject *__pyx_n_s_colloc;
4057 : PyObject *__pyx_n_s_colloc_nd;
4058 : PyObject *__pyx_kp_s_contiguous_and_direct;
4059 : PyObject *__pyx_kp_s_contiguous_and_indirect;
4060 : PyObject *__pyx_n_s_count;
4061 : PyObject *__pyx_n_s_csr_data;
4062 : PyObject *__pyx_n_s_csr_indices;
4063 : PyObject *__pyx_n_s_csr_indptr;
4064 : PyObject *__pyx_n_s_cstrides;
4065 : PyObject *__pyx_n_s_d;
4066 : PyObject *__pyx_n_s_data;
4067 : PyObject *__pyx_n_s_data_matrix;
4068 : PyObject *__pyx_n_s_defaults;
4069 : PyObject *__pyx_n_s_dict;
4070 : PyObject *__pyx_kp_u_disable;
4071 : PyObject *__pyx_n_s_dtype;
4072 : PyObject *__pyx_n_s_dtype_is_object;
4073 : PyObject *__pyx_n_s_empty;
4074 : PyObject *__pyx_n_s_empty_like;
4075 : PyObject *__pyx_kp_u_enable;
4076 : PyObject *__pyx_n_s_encode;
4077 : PyObject *__pyx_n_s_enumerate;
4078 : PyObject *__pyx_n_s_error;
4079 : PyObject *__pyx_n_s_evaluate_all_bspl;
4080 : PyObject *__pyx_kp_u_evaluate_all_bspl_line_181;
4081 : PyObject *__pyx_n_s_evaluate_ndbspline;
4082 : PyObject *__pyx_n_s_evaluate_spline;
4083 : PyObject *__pyx_n_s_extrapolate;
4084 : PyObject *__pyx_n_s_factor;
4085 : PyObject *__pyx_n_s_flags;
4086 : PyObject *__pyx_n_s_float64;
4087 : PyObject *__pyx_n_s_format;
4088 : PyObject *__pyx_n_s_fortran;
4089 : PyObject *__pyx_n_u_fortran;
4090 : PyObject *__pyx_n_s_fpback;
4091 : PyObject *__pyx_n_s_fpknot;
4092 : PyObject *__pyx_n_s_fused_sigindex;
4093 : PyObject *__pyx_kp_u_gc;
4094 : PyObject *__pyx_n_s_get;
4095 : PyObject *__pyx_n_s_getstate;
4096 : PyObject *__pyx_kp_u_got;
4097 : PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
4098 : PyObject *__pyx_kp_s_home_czgdp18079_Quansight_scipy;
4099 : PyObject *__pyx_n_s_i;
4100 : PyObject *__pyx_n_s_i_c;
4101 : PyObject *__pyx_n_s_id;
4102 : PyObject *__pyx_n_s_idx;
4103 : PyObject *__pyx_n_s_idx_b;
4104 : PyObject *__pyx_n_s_idx_c;
4105 : PyObject *__pyx_n_s_idx_cflat;
4106 : PyObject *__pyx_n_s_idx_cflat_base;
4107 : PyObject *__pyx_n_s_iflat;
4108 : PyObject *__pyx_n_s_import;
4109 : PyObject *__pyx_n_s_ind;
4110 : PyObject *__pyx_n_s_index;
4111 : PyObject *__pyx_n_s_indices;
4112 : PyObject *__pyx_n_s_indices_k1d;
4113 : PyObject *__pyx_n_s_indices_k1d_2;
4114 : PyObject *__pyx_n_s_initializing;
4115 : PyObject *__pyx_n_s_int64;
4116 : PyObject *__pyx_n_s_interval;
4117 : PyObject *__pyx_n_s_intp;
4118 : PyObject *__pyx_n_s_ip;
4119 : PyObject *__pyx_n_s_is_coroutine;
4120 : PyObject *__pyx_kp_u_isenabled;
4121 : PyObject *__pyx_n_s_itemsize;
4122 : PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
4123 : PyObject *__pyx_n_s_j;
4124 : PyObject *__pyx_n_s_jp;
4125 : PyObject *__pyx_n_s_k;
4126 : PyObject *__pyx_n_s_kd;
4127 : PyObject *__pyx_n_s_kind;
4128 : PyObject *__pyx_n_s_kl;
4129 : PyObject *__pyx_n_s_ku;
4130 : PyObject *__pyx_n_s_kwargs;
4131 : PyObject *__pyx_n_s_left;
4132 : PyObject *__pyx_kp_u_len_residuals;
4133 : PyObject *__pyx_n_s_len_t;
4134 : PyObject *__pyx_kp_u_len_w;
4135 : PyObject *__pyx_kp_u_len_x;
4136 : PyObject *__pyx_kp_u_len_x_2;
4137 : PyObject *__pyx_n_s_m;
4138 : PyObject *__pyx_kp_u_m_2;
4139 : PyObject *__pyx_kp_u_m_3;
4140 : PyObject *__pyx_n_s_main;
4141 : PyObject *__pyx_n_s_make_design_matrix;
4142 : PyObject *__pyx_n_s_max;
4143 : PyObject *__pyx_n_s_memview;
4144 : PyObject *__pyx_n_s_mode;
4145 : PyObject *__pyx_n_s_n;
4146 : PyObject *__pyx_n_s_name;
4147 : PyObject *__pyx_n_s_name_2;
4148 : PyObject *__pyx_n_s_nc;
4149 : PyObject *__pyx_kp_u_nc_2;
4150 : PyObject *__pyx_n_s_ndim;
4151 : PyObject *__pyx_n_s_new;
4152 : PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
4153 : PyObject *__pyx_n_s_norm_eq_lsq;
4154 : PyObject *__pyx_n_s_np;
4155 : PyObject *__pyx_n_s_npy_int32;
4156 : PyObject *__pyx_n_s_npy_int64;
4157 : PyObject *__pyx_n_s_nu;
4158 : PyObject *__pyx_n_s_num_c_tr;
4159 : PyObject *__pyx_n_s_numpy;
4160 : PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
4161 : PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
4162 : PyObject *__pyx_n_s_nz;
4163 : PyObject *__pyx_n_s_obj;
4164 : PyObject *__pyx_n_s_offset;
4165 : PyObject *__pyx_n_s_ones;
4166 : PyObject *__pyx_n_s_out;
4167 : PyObject *__pyx_kp_u_out_and_c_are_inconsistent_num_c;
4168 : PyObject *__pyx_kp_u_out_and_c_have_incompatible_shap;
4169 : PyObject *__pyx_kp_u_out_and_xi_are_inconsistent_expe;
4170 : PyObject *__pyx_kp_u_out_and_xp_have_incompatible_sha;
4171 : PyObject *__pyx_n_s_out_of_bounds;
4172 : PyObject *__pyx_kp_u_output_values_got;
4173 : PyObject *__pyx_n_s_pack;
4174 : PyObject *__pyx_n_s_pickle;
4175 : PyObject *__pyx_n_s_prev_l;
4176 : PyObject *__pyx_n_s_py_find_interval;
4177 : PyObject *__pyx_n_s_pyx_PickleError;
4178 : PyObject *__pyx_n_s_pyx_checksum;
4179 : PyObject *__pyx_n_s_pyx_result;
4180 : PyObject *__pyx_n_s_pyx_state;
4181 : PyObject *__pyx_n_s_pyx_type;
4182 : PyObject *__pyx_n_s_pyx_unpickle_Enum;
4183 : PyObject *__pyx_n_s_pyx_vtable;
4184 : PyObject *__pyx_n_s_qr_reduce;
4185 : PyObject *__pyx_n_s_r;
4186 : PyObject *__pyx_n_s_range;
4187 : PyObject *__pyx_n_s_reduce;
4188 : PyObject *__pyx_n_s_reduce_cython;
4189 : PyObject *__pyx_n_s_reduce_ex;
4190 : PyObject *__pyx_n_s_register;
4191 : PyObject *__pyx_n_s_residuals;
4192 : PyObject *__pyx_n_s_rhs;
4193 : PyObject *__pyx_n_s_row;
4194 : PyObject *__pyx_n_s_s;
4195 : PyObject *__pyx_n_s_scipy_interpolate__bspl;
4196 : PyObject *__pyx_n_s_setstate;
4197 : PyObject *__pyx_n_s_setstate_cython;
4198 : PyObject *__pyx_n_s_shape;
4199 : PyObject *__pyx_n_s_signatures;
4200 : PyObject *__pyx_n_s_size;
4201 : PyObject *__pyx_n_s_spec;
4202 : PyObject *__pyx_n_s_split;
4203 : PyObject *__pyx_n_s_start;
4204 : PyObject *__pyx_n_s_startrow;
4205 : PyObject *__pyx_n_s_step;
4206 : PyObject *__pyx_n_s_stop;
4207 : PyObject *__pyx_kp_s_strided_and_direct;
4208 : PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
4209 : PyObject *__pyx_kp_s_strided_and_indirect;
4210 : PyObject *__pyx_n_s_strides_c1;
4211 : PyObject *__pyx_kp_s_stringsource;
4212 : PyObject *__pyx_n_s_strip;
4213 : PyObject *__pyx_n_s_struct;
4214 : PyObject *__pyx_n_s_sys;
4215 : PyObject *__pyx_n_s_t;
4216 : PyObject *__pyx_n_s_t_2;
4217 : PyObject *__pyx_n_s_td;
4218 : PyObject *__pyx_n_s_test;
4219 : PyObject *__pyx_kp_s_unable_to_allocate_array_data;
4220 : PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
4221 : PyObject *__pyx_n_s_unpack;
4222 : PyObject *__pyx_n_s_update;
4223 : PyObject *__pyx_n_s_values;
4224 : PyObject *__pyx_n_s_version_info;
4225 : PyObject *__pyx_n_s_volume;
4226 : PyObject *__pyx_n_s_w;
4227 : PyObject *__pyx_kp_u_with_xv;
4228 : PyObject *__pyx_n_s_work;
4229 : PyObject *__pyx_n_s_wrk;
4230 : PyObject *__pyx_n_s_wval;
4231 : PyObject *__pyx_n_s_x;
4232 : PyObject *__pyx_n_s_xd;
4233 : PyObject *__pyx_n_s_xi;
4234 : PyObject *__pyx_n_s_xp;
4235 : PyObject *__pyx_n_s_xv;
4236 : PyObject *__pyx_n_s_xval;
4237 : PyObject *__pyx_n_s_xvals;
4238 : PyObject *__pyx_n_s_y;
4239 : PyObject *__pyx_kp_u_y_shape;
4240 : PyObject *__pyx_n_s_zeros;
4241 : PyObject *__pyx_int_0;
4242 : PyObject *__pyx_int_1;
4243 : PyObject *__pyx_int_2;
4244 : PyObject *__pyx_int_3;
4245 : PyObject *__pyx_int_5;
4246 : PyObject *__pyx_int_112105877;
4247 : PyObject *__pyx_int_136983863;
4248 : PyObject *__pyx_int_184977713;
4249 : PyObject *__pyx_int_neg_1;
4250 : PyObject *__pyx_int_neg_101;
4251 : PyObject *__pyx_slice__5;
4252 : PyObject *__pyx_tuple__4;
4253 : PyObject *__pyx_tuple__8;
4254 : PyObject *__pyx_tuple__9;
4255 : PyObject *__pyx_tuple__10;
4256 : PyObject *__pyx_tuple__11;
4257 : PyObject *__pyx_tuple__12;
4258 : PyObject *__pyx_tuple__15;
4259 : PyObject *__pyx_tuple__16;
4260 : PyObject *__pyx_tuple__17;
4261 : PyObject *__pyx_tuple__18;
4262 : PyObject *__pyx_tuple__19;
4263 : PyObject *__pyx_tuple__20;
4264 : PyObject *__pyx_tuple__21;
4265 : PyObject *__pyx_tuple__22;
4266 : PyObject *__pyx_tuple__23;
4267 : PyObject *__pyx_tuple__24;
4268 : PyObject *__pyx_tuple__25;
4269 : PyObject *__pyx_tuple__26;
4270 : PyObject *__pyx_tuple__28;
4271 : PyObject *__pyx_tuple__30;
4272 : PyObject *__pyx_tuple__32;
4273 : PyObject *__pyx_tuple__34;
4274 : PyObject *__pyx_tuple__36;
4275 : PyObject *__pyx_tuple__38;
4276 : PyObject *__pyx_tuple__40;
4277 : PyObject *__pyx_tuple__42;
4278 : PyObject *__pyx_tuple__44;
4279 : PyObject *__pyx_tuple__46;
4280 : PyObject *__pyx_tuple__48;
4281 : PyObject *__pyx_tuple__50;
4282 : PyObject *__pyx_codeobj__27;
4283 : PyObject *__pyx_codeobj__29;
4284 : PyObject *__pyx_codeobj__31;
4285 : PyObject *__pyx_codeobj__33;
4286 : PyObject *__pyx_codeobj__35;
4287 : PyObject *__pyx_codeobj__37;
4288 : PyObject *__pyx_codeobj__39;
4289 : PyObject *__pyx_codeobj__41;
4290 : PyObject *__pyx_codeobj__43;
4291 : PyObject *__pyx_codeobj__45;
4292 : PyObject *__pyx_codeobj__47;
4293 : PyObject *__pyx_codeobj__49;
4294 : PyObject *__pyx_codeobj__51;
4295 : } __pyx_mstate;
4296 :
4297 : #if CYTHON_USE_MODULE_STATE
4298 : #ifdef __cplusplus
4299 : namespace {
4300 : extern struct PyModuleDef __pyx_moduledef;
4301 : } /* anonymous namespace */
4302 : #else
4303 : static struct PyModuleDef __pyx_moduledef;
4304 : #endif
4305 :
4306 : #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
4307 :
4308 : #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
4309 :
4310 : #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
4311 : #else
4312 : static __pyx_mstate __pyx_mstate_global_static =
4313 : #ifdef __cplusplus
4314 : {};
4315 : #else
4316 : {0};
4317 : #endif
4318 : static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
4319 : #endif
4320 : /* #### Code section: module_state_clear ### */
4321 : #if CYTHON_USE_MODULE_STATE
4322 : static int __pyx_m_clear(PyObject *m) {
4323 : __pyx_mstate *clear_module_state = __pyx_mstate(m);
4324 : if (!clear_module_state) return 0;
4325 : Py_CLEAR(clear_module_state->__pyx_d);
4326 : Py_CLEAR(clear_module_state->__pyx_b);
4327 : Py_CLEAR(clear_module_state->__pyx_cython_runtime);
4328 : Py_CLEAR(clear_module_state->__pyx_empty_tuple);
4329 : Py_CLEAR(clear_module_state->__pyx_empty_bytes);
4330 : Py_CLEAR(clear_module_state->__pyx_empty_unicode);
4331 : #ifdef __Pyx_CyFunction_USED
4332 : Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
4333 : #endif
4334 : #ifdef __Pyx_FusedFunction_USED
4335 : Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
4336 : #endif
4337 : Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
4338 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
4339 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
4340 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
4341 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
4342 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
4343 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
4344 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
4345 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
4346 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
4347 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
4348 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
4349 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
4350 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
4351 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
4352 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
4353 : Py_CLEAR(clear_module_state->__pyx_array_type);
4354 : Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
4355 : Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
4356 : Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
4357 : Py_CLEAR(clear_module_state->__pyx_memoryview_type);
4358 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
4359 : Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
4360 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
4361 : Py_CLEAR(clear_module_state->__pyx_kp_u_);
4362 : Py_CLEAR(clear_module_state->__pyx_n_s_A);
4363 : Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
4364 : Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4365 : Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
4366 : Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4367 : Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4368 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4369 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4370 : Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_do_derivative_order_s);
4371 : Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
4372 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4373 : Py_CLEAR(clear_module_state->__pyx_kp_u_D_points);
4374 : Py_CLEAR(clear_module_state->__pyx_kp_u_D_space_got);
4375 : Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4376 : Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
4377 : Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4378 : Py_CLEAR(clear_module_state->__pyx_kp_u_Evaluate_the_k_1_B_splines_which);
4379 : Py_CLEAR(clear_module_state->__pyx_kp_u_Expacted_data_points_in);
4380 : Py_CLEAR(clear_module_state->__pyx_kp_s_Expected_at_least_d_argument_s_g);
4381 : Py_CLEAR(clear_module_state->__pyx_kp_s_Function_call_with_ambiguous_arg);
4382 : Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
4383 : Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4384 : Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
4385 : Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4386 : Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4387 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4388 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4389 : Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
4390 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4391 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
4392 : Py_CLEAR(clear_module_state->__pyx_kp_s_No_matching_signature_found);
4393 : Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError);
4394 : Py_CLEAR(clear_module_state->__pyx_n_b_O);
4395 : Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_in_d);
4396 : Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4397 : Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
4398 : Py_CLEAR(clear_module_state->__pyx_n_s_R);
4399 : Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
4400 : Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4401 : Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
4402 : Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4403 : Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
4404 : Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
4405 : Py_CLEAR(clear_module_state->__pyx_kp_s__13);
4406 : Py_CLEAR(clear_module_state->__pyx_kp_s__14);
4407 : Py_CLEAR(clear_module_state->__pyx_kp_u__14);
4408 : Py_CLEAR(clear_module_state->__pyx_kp_u__2);
4409 : Py_CLEAR(clear_module_state->__pyx_n_s__3);
4410 : Py_CLEAR(clear_module_state->__pyx_n_s__52);
4411 : Py_CLEAR(clear_module_state->__pyx_kp_u__6);
4412 : Py_CLEAR(clear_module_state->__pyx_kp_u__7);
4413 : Py_CLEAR(clear_module_state->__pyx_n_s_a);
4414 : Py_CLEAR(clear_module_state->__pyx_n_s_ab);
4415 : Py_CLEAR(clear_module_state->__pyx_n_s_abc);
4416 : Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
4417 : Py_CLEAR(clear_module_state->__pyx_kp_u_and);
4418 : Py_CLEAR(clear_module_state->__pyx_kp_u_and_out_shape_1);
4419 : Py_CLEAR(clear_module_state->__pyx_n_s_arange);
4420 : Py_CLEAR(clear_module_state->__pyx_n_s_args);
4421 : Py_CLEAR(clear_module_state->__pyx_n_s_asarray);
4422 : Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
4423 : Py_CLEAR(clear_module_state->__pyx_n_s_b);
4424 : Py_CLEAR(clear_module_state->__pyx_n_s_base);
4425 : Py_CLEAR(clear_module_state->__pyx_n_s_bbb);
4426 : Py_CLEAR(clear_module_state->__pyx_n_s_c);
4427 : Py_CLEAR(clear_module_state->__pyx_n_u_c);
4428 : Py_CLEAR(clear_module_state->__pyx_n_s_c1r);
4429 : Py_CLEAR(clear_module_state->__pyx_n_s_ci);
4430 : Py_CLEAR(clear_module_state->__pyx_n_s_class);
4431 : Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
4432 : Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
4433 : Py_CLEAR(clear_module_state->__pyx_n_s_clmn);
4434 : Py_CLEAR(clear_module_state->__pyx_n_s_collections);
4435 : Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
4436 : Py_CLEAR(clear_module_state->__pyx_n_s_colloc);
4437 : Py_CLEAR(clear_module_state->__pyx_n_s_colloc_nd);
4438 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
4439 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
4440 : Py_CLEAR(clear_module_state->__pyx_n_s_count);
4441 : Py_CLEAR(clear_module_state->__pyx_n_s_csr_data);
4442 : Py_CLEAR(clear_module_state->__pyx_n_s_csr_indices);
4443 : Py_CLEAR(clear_module_state->__pyx_n_s_csr_indptr);
4444 : Py_CLEAR(clear_module_state->__pyx_n_s_cstrides);
4445 : Py_CLEAR(clear_module_state->__pyx_n_s_d);
4446 : Py_CLEAR(clear_module_state->__pyx_n_s_data);
4447 : Py_CLEAR(clear_module_state->__pyx_n_s_data_matrix);
4448 : Py_CLEAR(clear_module_state->__pyx_n_s_defaults);
4449 : Py_CLEAR(clear_module_state->__pyx_n_s_dict);
4450 : Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
4451 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
4452 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
4453 : Py_CLEAR(clear_module_state->__pyx_n_s_empty);
4454 : Py_CLEAR(clear_module_state->__pyx_n_s_empty_like);
4455 : Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
4456 : Py_CLEAR(clear_module_state->__pyx_n_s_encode);
4457 : Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
4458 : Py_CLEAR(clear_module_state->__pyx_n_s_error);
4459 : Py_CLEAR(clear_module_state->__pyx_n_s_evaluate_all_bspl);
4460 : Py_CLEAR(clear_module_state->__pyx_kp_u_evaluate_all_bspl_line_181);
4461 : Py_CLEAR(clear_module_state->__pyx_n_s_evaluate_ndbspline);
4462 : Py_CLEAR(clear_module_state->__pyx_n_s_evaluate_spline);
4463 : Py_CLEAR(clear_module_state->__pyx_n_s_extrapolate);
4464 : Py_CLEAR(clear_module_state->__pyx_n_s_factor);
4465 : Py_CLEAR(clear_module_state->__pyx_n_s_flags);
4466 : Py_CLEAR(clear_module_state->__pyx_n_s_float64);
4467 : Py_CLEAR(clear_module_state->__pyx_n_s_format);
4468 : Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
4469 : Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
4470 : Py_CLEAR(clear_module_state->__pyx_n_s_fpback);
4471 : Py_CLEAR(clear_module_state->__pyx_n_s_fpknot);
4472 : Py_CLEAR(clear_module_state->__pyx_n_s_fused_sigindex);
4473 : Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
4474 : Py_CLEAR(clear_module_state->__pyx_n_s_get);
4475 : Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
4476 : Py_CLEAR(clear_module_state->__pyx_kp_u_got);
4477 : Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4478 : Py_CLEAR(clear_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4479 : Py_CLEAR(clear_module_state->__pyx_n_s_i);
4480 : Py_CLEAR(clear_module_state->__pyx_n_s_i_c);
4481 : Py_CLEAR(clear_module_state->__pyx_n_s_id);
4482 : Py_CLEAR(clear_module_state->__pyx_n_s_idx);
4483 : Py_CLEAR(clear_module_state->__pyx_n_s_idx_b);
4484 : Py_CLEAR(clear_module_state->__pyx_n_s_idx_c);
4485 : Py_CLEAR(clear_module_state->__pyx_n_s_idx_cflat);
4486 : Py_CLEAR(clear_module_state->__pyx_n_s_idx_cflat_base);
4487 : Py_CLEAR(clear_module_state->__pyx_n_s_iflat);
4488 : Py_CLEAR(clear_module_state->__pyx_n_s_import);
4489 : Py_CLEAR(clear_module_state->__pyx_n_s_ind);
4490 : Py_CLEAR(clear_module_state->__pyx_n_s_index);
4491 : Py_CLEAR(clear_module_state->__pyx_n_s_indices);
4492 : Py_CLEAR(clear_module_state->__pyx_n_s_indices_k1d);
4493 : Py_CLEAR(clear_module_state->__pyx_n_s_indices_k1d_2);
4494 : Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
4495 : Py_CLEAR(clear_module_state->__pyx_n_s_int64);
4496 : Py_CLEAR(clear_module_state->__pyx_n_s_interval);
4497 : Py_CLEAR(clear_module_state->__pyx_n_s_intp);
4498 : Py_CLEAR(clear_module_state->__pyx_n_s_ip);
4499 : Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
4500 : Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
4501 : Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
4502 : Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4503 : Py_CLEAR(clear_module_state->__pyx_n_s_j);
4504 : Py_CLEAR(clear_module_state->__pyx_n_s_jp);
4505 : Py_CLEAR(clear_module_state->__pyx_n_s_k);
4506 : Py_CLEAR(clear_module_state->__pyx_n_s_kd);
4507 : Py_CLEAR(clear_module_state->__pyx_n_s_kind);
4508 : Py_CLEAR(clear_module_state->__pyx_n_s_kl);
4509 : Py_CLEAR(clear_module_state->__pyx_n_s_ku);
4510 : Py_CLEAR(clear_module_state->__pyx_n_s_kwargs);
4511 : Py_CLEAR(clear_module_state->__pyx_n_s_left);
4512 : Py_CLEAR(clear_module_state->__pyx_kp_u_len_residuals);
4513 : Py_CLEAR(clear_module_state->__pyx_n_s_len_t);
4514 : Py_CLEAR(clear_module_state->__pyx_kp_u_len_w);
4515 : Py_CLEAR(clear_module_state->__pyx_kp_u_len_x);
4516 : Py_CLEAR(clear_module_state->__pyx_kp_u_len_x_2);
4517 : Py_CLEAR(clear_module_state->__pyx_n_s_m);
4518 : Py_CLEAR(clear_module_state->__pyx_kp_u_m_2);
4519 : Py_CLEAR(clear_module_state->__pyx_kp_u_m_3);
4520 : Py_CLEAR(clear_module_state->__pyx_n_s_main);
4521 : Py_CLEAR(clear_module_state->__pyx_n_s_make_design_matrix);
4522 : Py_CLEAR(clear_module_state->__pyx_n_s_max);
4523 : Py_CLEAR(clear_module_state->__pyx_n_s_memview);
4524 : Py_CLEAR(clear_module_state->__pyx_n_s_mode);
4525 : Py_CLEAR(clear_module_state->__pyx_n_s_n);
4526 : Py_CLEAR(clear_module_state->__pyx_n_s_name);
4527 : Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
4528 : Py_CLEAR(clear_module_state->__pyx_n_s_nc);
4529 : Py_CLEAR(clear_module_state->__pyx_kp_u_nc_2);
4530 : Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
4531 : Py_CLEAR(clear_module_state->__pyx_n_s_new);
4532 : Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4533 : Py_CLEAR(clear_module_state->__pyx_n_s_norm_eq_lsq);
4534 : Py_CLEAR(clear_module_state->__pyx_n_s_np);
4535 : Py_CLEAR(clear_module_state->__pyx_n_s_npy_int32);
4536 : Py_CLEAR(clear_module_state->__pyx_n_s_npy_int64);
4537 : Py_CLEAR(clear_module_state->__pyx_n_s_nu);
4538 : Py_CLEAR(clear_module_state->__pyx_n_s_num_c_tr);
4539 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
4540 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4541 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4542 : Py_CLEAR(clear_module_state->__pyx_n_s_nz);
4543 : Py_CLEAR(clear_module_state->__pyx_n_s_obj);
4544 : Py_CLEAR(clear_module_state->__pyx_n_s_offset);
4545 : Py_CLEAR(clear_module_state->__pyx_n_s_ones);
4546 : Py_CLEAR(clear_module_state->__pyx_n_s_out);
4547 : Py_CLEAR(clear_module_state->__pyx_kp_u_out_and_c_are_inconsistent_num_c);
4548 : Py_CLEAR(clear_module_state->__pyx_kp_u_out_and_c_have_incompatible_shap);
4549 : Py_CLEAR(clear_module_state->__pyx_kp_u_out_and_xi_are_inconsistent_expe);
4550 : Py_CLEAR(clear_module_state->__pyx_kp_u_out_and_xp_have_incompatible_sha);
4551 : Py_CLEAR(clear_module_state->__pyx_n_s_out_of_bounds);
4552 : Py_CLEAR(clear_module_state->__pyx_kp_u_output_values_got);
4553 : Py_CLEAR(clear_module_state->__pyx_n_s_pack);
4554 : Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
4555 : Py_CLEAR(clear_module_state->__pyx_n_s_prev_l);
4556 : Py_CLEAR(clear_module_state->__pyx_n_s_py_find_interval);
4557 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
4558 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
4559 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
4560 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
4561 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
4562 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
4563 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
4564 : Py_CLEAR(clear_module_state->__pyx_n_s_qr_reduce);
4565 : Py_CLEAR(clear_module_state->__pyx_n_s_r);
4566 : Py_CLEAR(clear_module_state->__pyx_n_s_range);
4567 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
4568 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
4569 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
4570 : Py_CLEAR(clear_module_state->__pyx_n_s_register);
4571 : Py_CLEAR(clear_module_state->__pyx_n_s_residuals);
4572 : Py_CLEAR(clear_module_state->__pyx_n_s_rhs);
4573 : Py_CLEAR(clear_module_state->__pyx_n_s_row);
4574 : Py_CLEAR(clear_module_state->__pyx_n_s_s);
4575 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_interpolate__bspl);
4576 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
4577 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
4578 : Py_CLEAR(clear_module_state->__pyx_n_s_shape);
4579 : Py_CLEAR(clear_module_state->__pyx_n_s_signatures);
4580 : Py_CLEAR(clear_module_state->__pyx_n_s_size);
4581 : Py_CLEAR(clear_module_state->__pyx_n_s_spec);
4582 : Py_CLEAR(clear_module_state->__pyx_n_s_split);
4583 : Py_CLEAR(clear_module_state->__pyx_n_s_start);
4584 : Py_CLEAR(clear_module_state->__pyx_n_s_startrow);
4585 : Py_CLEAR(clear_module_state->__pyx_n_s_step);
4586 : Py_CLEAR(clear_module_state->__pyx_n_s_stop);
4587 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
4588 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4589 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
4590 : Py_CLEAR(clear_module_state->__pyx_n_s_strides_c1);
4591 : Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
4592 : Py_CLEAR(clear_module_state->__pyx_n_s_strip);
4593 : Py_CLEAR(clear_module_state->__pyx_n_s_struct);
4594 : Py_CLEAR(clear_module_state->__pyx_n_s_sys);
4595 : Py_CLEAR(clear_module_state->__pyx_n_s_t);
4596 : Py_CLEAR(clear_module_state->__pyx_n_s_t_2);
4597 : Py_CLEAR(clear_module_state->__pyx_n_s_td);
4598 : Py_CLEAR(clear_module_state->__pyx_n_s_test);
4599 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4600 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4601 : Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
4602 : Py_CLEAR(clear_module_state->__pyx_n_s_update);
4603 : Py_CLEAR(clear_module_state->__pyx_n_s_values);
4604 : Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
4605 : Py_CLEAR(clear_module_state->__pyx_n_s_volume);
4606 : Py_CLEAR(clear_module_state->__pyx_n_s_w);
4607 : Py_CLEAR(clear_module_state->__pyx_kp_u_with_xv);
4608 : Py_CLEAR(clear_module_state->__pyx_n_s_work);
4609 : Py_CLEAR(clear_module_state->__pyx_n_s_wrk);
4610 : Py_CLEAR(clear_module_state->__pyx_n_s_wval);
4611 : Py_CLEAR(clear_module_state->__pyx_n_s_x);
4612 : Py_CLEAR(clear_module_state->__pyx_n_s_xd);
4613 : Py_CLEAR(clear_module_state->__pyx_n_s_xi);
4614 : Py_CLEAR(clear_module_state->__pyx_n_s_xp);
4615 : Py_CLEAR(clear_module_state->__pyx_n_s_xv);
4616 : Py_CLEAR(clear_module_state->__pyx_n_s_xval);
4617 : Py_CLEAR(clear_module_state->__pyx_n_s_xvals);
4618 : Py_CLEAR(clear_module_state->__pyx_n_s_y);
4619 : Py_CLEAR(clear_module_state->__pyx_kp_u_y_shape);
4620 : Py_CLEAR(clear_module_state->__pyx_n_s_zeros);
4621 : Py_CLEAR(clear_module_state->__pyx_int_0);
4622 : Py_CLEAR(clear_module_state->__pyx_int_1);
4623 : Py_CLEAR(clear_module_state->__pyx_int_2);
4624 : Py_CLEAR(clear_module_state->__pyx_int_3);
4625 : Py_CLEAR(clear_module_state->__pyx_int_5);
4626 : Py_CLEAR(clear_module_state->__pyx_int_112105877);
4627 : Py_CLEAR(clear_module_state->__pyx_int_136983863);
4628 : Py_CLEAR(clear_module_state->__pyx_int_184977713);
4629 : Py_CLEAR(clear_module_state->__pyx_int_neg_1);
4630 : Py_CLEAR(clear_module_state->__pyx_int_neg_101);
4631 : Py_CLEAR(clear_module_state->__pyx_slice__5);
4632 : Py_CLEAR(clear_module_state->__pyx_tuple__4);
4633 : Py_CLEAR(clear_module_state->__pyx_tuple__8);
4634 : Py_CLEAR(clear_module_state->__pyx_tuple__9);
4635 : Py_CLEAR(clear_module_state->__pyx_tuple__10);
4636 : Py_CLEAR(clear_module_state->__pyx_tuple__11);
4637 : Py_CLEAR(clear_module_state->__pyx_tuple__12);
4638 : Py_CLEAR(clear_module_state->__pyx_tuple__15);
4639 : Py_CLEAR(clear_module_state->__pyx_tuple__16);
4640 : Py_CLEAR(clear_module_state->__pyx_tuple__17);
4641 : Py_CLEAR(clear_module_state->__pyx_tuple__18);
4642 : Py_CLEAR(clear_module_state->__pyx_tuple__19);
4643 : Py_CLEAR(clear_module_state->__pyx_tuple__20);
4644 : Py_CLEAR(clear_module_state->__pyx_tuple__21);
4645 : Py_CLEAR(clear_module_state->__pyx_tuple__22);
4646 : Py_CLEAR(clear_module_state->__pyx_tuple__23);
4647 : Py_CLEAR(clear_module_state->__pyx_tuple__24);
4648 : Py_CLEAR(clear_module_state->__pyx_tuple__25);
4649 : Py_CLEAR(clear_module_state->__pyx_tuple__26);
4650 : Py_CLEAR(clear_module_state->__pyx_tuple__28);
4651 : Py_CLEAR(clear_module_state->__pyx_tuple__30);
4652 : Py_CLEAR(clear_module_state->__pyx_tuple__32);
4653 : Py_CLEAR(clear_module_state->__pyx_tuple__34);
4654 : Py_CLEAR(clear_module_state->__pyx_tuple__36);
4655 : Py_CLEAR(clear_module_state->__pyx_tuple__38);
4656 : Py_CLEAR(clear_module_state->__pyx_tuple__40);
4657 : Py_CLEAR(clear_module_state->__pyx_tuple__42);
4658 : Py_CLEAR(clear_module_state->__pyx_tuple__44);
4659 : Py_CLEAR(clear_module_state->__pyx_tuple__46);
4660 : Py_CLEAR(clear_module_state->__pyx_tuple__48);
4661 : Py_CLEAR(clear_module_state->__pyx_tuple__50);
4662 : Py_CLEAR(clear_module_state->__pyx_codeobj__27);
4663 : Py_CLEAR(clear_module_state->__pyx_codeobj__29);
4664 : Py_CLEAR(clear_module_state->__pyx_codeobj__31);
4665 : Py_CLEAR(clear_module_state->__pyx_codeobj__33);
4666 : Py_CLEAR(clear_module_state->__pyx_codeobj__35);
4667 : Py_CLEAR(clear_module_state->__pyx_codeobj__37);
4668 : Py_CLEAR(clear_module_state->__pyx_codeobj__39);
4669 : Py_CLEAR(clear_module_state->__pyx_codeobj__41);
4670 : Py_CLEAR(clear_module_state->__pyx_codeobj__43);
4671 : Py_CLEAR(clear_module_state->__pyx_codeobj__45);
4672 : Py_CLEAR(clear_module_state->__pyx_codeobj__47);
4673 : Py_CLEAR(clear_module_state->__pyx_codeobj__49);
4674 : Py_CLEAR(clear_module_state->__pyx_codeobj__51);
4675 : return 0;
4676 : }
4677 : #endif
4678 : /* #### Code section: module_state_traverse ### */
4679 : #if CYTHON_USE_MODULE_STATE
4680 : static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4681 : __pyx_mstate *traverse_module_state = __pyx_mstate(m);
4682 : if (!traverse_module_state) return 0;
4683 : Py_VISIT(traverse_module_state->__pyx_d);
4684 : Py_VISIT(traverse_module_state->__pyx_b);
4685 : Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4686 : Py_VISIT(traverse_module_state->__pyx_empty_tuple);
4687 : Py_VISIT(traverse_module_state->__pyx_empty_bytes);
4688 : Py_VISIT(traverse_module_state->__pyx_empty_unicode);
4689 : #ifdef __Pyx_CyFunction_USED
4690 : Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4691 : #endif
4692 : #ifdef __Pyx_FusedFunction_USED
4693 : Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
4694 : #endif
4695 : Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4696 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4697 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4698 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4699 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4700 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4701 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4702 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4703 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4704 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4705 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4706 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4707 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4708 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4709 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4710 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4711 : Py_VISIT(traverse_module_state->__pyx_array_type);
4712 : Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4713 : Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4714 : Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4715 : Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4716 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4717 : Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4718 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4719 : Py_VISIT(traverse_module_state->__pyx_kp_u_);
4720 : Py_VISIT(traverse_module_state->__pyx_n_s_A);
4721 : Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
4722 : Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4723 : Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
4724 : Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4725 : Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4726 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4727 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4728 : Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_do_derivative_order_s);
4729 : Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
4730 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4731 : Py_VISIT(traverse_module_state->__pyx_kp_u_D_points);
4732 : Py_VISIT(traverse_module_state->__pyx_kp_u_D_space_got);
4733 : Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4734 : Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
4735 : Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4736 : Py_VISIT(traverse_module_state->__pyx_kp_u_Evaluate_the_k_1_B_splines_which);
4737 : Py_VISIT(traverse_module_state->__pyx_kp_u_Expacted_data_points_in);
4738 : Py_VISIT(traverse_module_state->__pyx_kp_s_Expected_at_least_d_argument_s_g);
4739 : Py_VISIT(traverse_module_state->__pyx_kp_s_Function_call_with_ambiguous_arg);
4740 : Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
4741 : Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4742 : Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
4743 : Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4744 : Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4745 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4746 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4747 : Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
4748 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4749 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
4750 : Py_VISIT(traverse_module_state->__pyx_kp_s_No_matching_signature_found);
4751 : Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError);
4752 : Py_VISIT(traverse_module_state->__pyx_n_b_O);
4753 : Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_in_d);
4754 : Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4755 : Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
4756 : Py_VISIT(traverse_module_state->__pyx_n_s_R);
4757 : Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
4758 : Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4759 : Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
4760 : Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4761 : Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
4762 : Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
4763 : Py_VISIT(traverse_module_state->__pyx_kp_s__13);
4764 : Py_VISIT(traverse_module_state->__pyx_kp_s__14);
4765 : Py_VISIT(traverse_module_state->__pyx_kp_u__14);
4766 : Py_VISIT(traverse_module_state->__pyx_kp_u__2);
4767 : Py_VISIT(traverse_module_state->__pyx_n_s__3);
4768 : Py_VISIT(traverse_module_state->__pyx_n_s__52);
4769 : Py_VISIT(traverse_module_state->__pyx_kp_u__6);
4770 : Py_VISIT(traverse_module_state->__pyx_kp_u__7);
4771 : Py_VISIT(traverse_module_state->__pyx_n_s_a);
4772 : Py_VISIT(traverse_module_state->__pyx_n_s_ab);
4773 : Py_VISIT(traverse_module_state->__pyx_n_s_abc);
4774 : Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
4775 : Py_VISIT(traverse_module_state->__pyx_kp_u_and);
4776 : Py_VISIT(traverse_module_state->__pyx_kp_u_and_out_shape_1);
4777 : Py_VISIT(traverse_module_state->__pyx_n_s_arange);
4778 : Py_VISIT(traverse_module_state->__pyx_n_s_args);
4779 : Py_VISIT(traverse_module_state->__pyx_n_s_asarray);
4780 : Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
4781 : Py_VISIT(traverse_module_state->__pyx_n_s_b);
4782 : Py_VISIT(traverse_module_state->__pyx_n_s_base);
4783 : Py_VISIT(traverse_module_state->__pyx_n_s_bbb);
4784 : Py_VISIT(traverse_module_state->__pyx_n_s_c);
4785 : Py_VISIT(traverse_module_state->__pyx_n_u_c);
4786 : Py_VISIT(traverse_module_state->__pyx_n_s_c1r);
4787 : Py_VISIT(traverse_module_state->__pyx_n_s_ci);
4788 : Py_VISIT(traverse_module_state->__pyx_n_s_class);
4789 : Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
4790 : Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
4791 : Py_VISIT(traverse_module_state->__pyx_n_s_clmn);
4792 : Py_VISIT(traverse_module_state->__pyx_n_s_collections);
4793 : Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
4794 : Py_VISIT(traverse_module_state->__pyx_n_s_colloc);
4795 : Py_VISIT(traverse_module_state->__pyx_n_s_colloc_nd);
4796 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
4797 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
4798 : Py_VISIT(traverse_module_state->__pyx_n_s_count);
4799 : Py_VISIT(traverse_module_state->__pyx_n_s_csr_data);
4800 : Py_VISIT(traverse_module_state->__pyx_n_s_csr_indices);
4801 : Py_VISIT(traverse_module_state->__pyx_n_s_csr_indptr);
4802 : Py_VISIT(traverse_module_state->__pyx_n_s_cstrides);
4803 : Py_VISIT(traverse_module_state->__pyx_n_s_d);
4804 : Py_VISIT(traverse_module_state->__pyx_n_s_data);
4805 : Py_VISIT(traverse_module_state->__pyx_n_s_data_matrix);
4806 : Py_VISIT(traverse_module_state->__pyx_n_s_defaults);
4807 : Py_VISIT(traverse_module_state->__pyx_n_s_dict);
4808 : Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
4809 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
4810 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
4811 : Py_VISIT(traverse_module_state->__pyx_n_s_empty);
4812 : Py_VISIT(traverse_module_state->__pyx_n_s_empty_like);
4813 : Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
4814 : Py_VISIT(traverse_module_state->__pyx_n_s_encode);
4815 : Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
4816 : Py_VISIT(traverse_module_state->__pyx_n_s_error);
4817 : Py_VISIT(traverse_module_state->__pyx_n_s_evaluate_all_bspl);
4818 : Py_VISIT(traverse_module_state->__pyx_kp_u_evaluate_all_bspl_line_181);
4819 : Py_VISIT(traverse_module_state->__pyx_n_s_evaluate_ndbspline);
4820 : Py_VISIT(traverse_module_state->__pyx_n_s_evaluate_spline);
4821 : Py_VISIT(traverse_module_state->__pyx_n_s_extrapolate);
4822 : Py_VISIT(traverse_module_state->__pyx_n_s_factor);
4823 : Py_VISIT(traverse_module_state->__pyx_n_s_flags);
4824 : Py_VISIT(traverse_module_state->__pyx_n_s_float64);
4825 : Py_VISIT(traverse_module_state->__pyx_n_s_format);
4826 : Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
4827 : Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
4828 : Py_VISIT(traverse_module_state->__pyx_n_s_fpback);
4829 : Py_VISIT(traverse_module_state->__pyx_n_s_fpknot);
4830 : Py_VISIT(traverse_module_state->__pyx_n_s_fused_sigindex);
4831 : Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
4832 : Py_VISIT(traverse_module_state->__pyx_n_s_get);
4833 : Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
4834 : Py_VISIT(traverse_module_state->__pyx_kp_u_got);
4835 : Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4836 : Py_VISIT(traverse_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4837 : Py_VISIT(traverse_module_state->__pyx_n_s_i);
4838 : Py_VISIT(traverse_module_state->__pyx_n_s_i_c);
4839 : Py_VISIT(traverse_module_state->__pyx_n_s_id);
4840 : Py_VISIT(traverse_module_state->__pyx_n_s_idx);
4841 : Py_VISIT(traverse_module_state->__pyx_n_s_idx_b);
4842 : Py_VISIT(traverse_module_state->__pyx_n_s_idx_c);
4843 : Py_VISIT(traverse_module_state->__pyx_n_s_idx_cflat);
4844 : Py_VISIT(traverse_module_state->__pyx_n_s_idx_cflat_base);
4845 : Py_VISIT(traverse_module_state->__pyx_n_s_iflat);
4846 : Py_VISIT(traverse_module_state->__pyx_n_s_import);
4847 : Py_VISIT(traverse_module_state->__pyx_n_s_ind);
4848 : Py_VISIT(traverse_module_state->__pyx_n_s_index);
4849 : Py_VISIT(traverse_module_state->__pyx_n_s_indices);
4850 : Py_VISIT(traverse_module_state->__pyx_n_s_indices_k1d);
4851 : Py_VISIT(traverse_module_state->__pyx_n_s_indices_k1d_2);
4852 : Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
4853 : Py_VISIT(traverse_module_state->__pyx_n_s_int64);
4854 : Py_VISIT(traverse_module_state->__pyx_n_s_interval);
4855 : Py_VISIT(traverse_module_state->__pyx_n_s_intp);
4856 : Py_VISIT(traverse_module_state->__pyx_n_s_ip);
4857 : Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
4858 : Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
4859 : Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
4860 : Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4861 : Py_VISIT(traverse_module_state->__pyx_n_s_j);
4862 : Py_VISIT(traverse_module_state->__pyx_n_s_jp);
4863 : Py_VISIT(traverse_module_state->__pyx_n_s_k);
4864 : Py_VISIT(traverse_module_state->__pyx_n_s_kd);
4865 : Py_VISIT(traverse_module_state->__pyx_n_s_kind);
4866 : Py_VISIT(traverse_module_state->__pyx_n_s_kl);
4867 : Py_VISIT(traverse_module_state->__pyx_n_s_ku);
4868 : Py_VISIT(traverse_module_state->__pyx_n_s_kwargs);
4869 : Py_VISIT(traverse_module_state->__pyx_n_s_left);
4870 : Py_VISIT(traverse_module_state->__pyx_kp_u_len_residuals);
4871 : Py_VISIT(traverse_module_state->__pyx_n_s_len_t);
4872 : Py_VISIT(traverse_module_state->__pyx_kp_u_len_w);
4873 : Py_VISIT(traverse_module_state->__pyx_kp_u_len_x);
4874 : Py_VISIT(traverse_module_state->__pyx_kp_u_len_x_2);
4875 : Py_VISIT(traverse_module_state->__pyx_n_s_m);
4876 : Py_VISIT(traverse_module_state->__pyx_kp_u_m_2);
4877 : Py_VISIT(traverse_module_state->__pyx_kp_u_m_3);
4878 : Py_VISIT(traverse_module_state->__pyx_n_s_main);
4879 : Py_VISIT(traverse_module_state->__pyx_n_s_make_design_matrix);
4880 : Py_VISIT(traverse_module_state->__pyx_n_s_max);
4881 : Py_VISIT(traverse_module_state->__pyx_n_s_memview);
4882 : Py_VISIT(traverse_module_state->__pyx_n_s_mode);
4883 : Py_VISIT(traverse_module_state->__pyx_n_s_n);
4884 : Py_VISIT(traverse_module_state->__pyx_n_s_name);
4885 : Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
4886 : Py_VISIT(traverse_module_state->__pyx_n_s_nc);
4887 : Py_VISIT(traverse_module_state->__pyx_kp_u_nc_2);
4888 : Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
4889 : Py_VISIT(traverse_module_state->__pyx_n_s_new);
4890 : Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4891 : Py_VISIT(traverse_module_state->__pyx_n_s_norm_eq_lsq);
4892 : Py_VISIT(traverse_module_state->__pyx_n_s_np);
4893 : Py_VISIT(traverse_module_state->__pyx_n_s_npy_int32);
4894 : Py_VISIT(traverse_module_state->__pyx_n_s_npy_int64);
4895 : Py_VISIT(traverse_module_state->__pyx_n_s_nu);
4896 : Py_VISIT(traverse_module_state->__pyx_n_s_num_c_tr);
4897 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
4898 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4899 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4900 : Py_VISIT(traverse_module_state->__pyx_n_s_nz);
4901 : Py_VISIT(traverse_module_state->__pyx_n_s_obj);
4902 : Py_VISIT(traverse_module_state->__pyx_n_s_offset);
4903 : Py_VISIT(traverse_module_state->__pyx_n_s_ones);
4904 : Py_VISIT(traverse_module_state->__pyx_n_s_out);
4905 : Py_VISIT(traverse_module_state->__pyx_kp_u_out_and_c_are_inconsistent_num_c);
4906 : Py_VISIT(traverse_module_state->__pyx_kp_u_out_and_c_have_incompatible_shap);
4907 : Py_VISIT(traverse_module_state->__pyx_kp_u_out_and_xi_are_inconsistent_expe);
4908 : Py_VISIT(traverse_module_state->__pyx_kp_u_out_and_xp_have_incompatible_sha);
4909 : Py_VISIT(traverse_module_state->__pyx_n_s_out_of_bounds);
4910 : Py_VISIT(traverse_module_state->__pyx_kp_u_output_values_got);
4911 : Py_VISIT(traverse_module_state->__pyx_n_s_pack);
4912 : Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
4913 : Py_VISIT(traverse_module_state->__pyx_n_s_prev_l);
4914 : Py_VISIT(traverse_module_state->__pyx_n_s_py_find_interval);
4915 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
4916 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
4917 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
4918 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
4919 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
4920 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
4921 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
4922 : Py_VISIT(traverse_module_state->__pyx_n_s_qr_reduce);
4923 : Py_VISIT(traverse_module_state->__pyx_n_s_r);
4924 : Py_VISIT(traverse_module_state->__pyx_n_s_range);
4925 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
4926 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
4927 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
4928 : Py_VISIT(traverse_module_state->__pyx_n_s_register);
4929 : Py_VISIT(traverse_module_state->__pyx_n_s_residuals);
4930 : Py_VISIT(traverse_module_state->__pyx_n_s_rhs);
4931 : Py_VISIT(traverse_module_state->__pyx_n_s_row);
4932 : Py_VISIT(traverse_module_state->__pyx_n_s_s);
4933 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_interpolate__bspl);
4934 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
4935 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
4936 : Py_VISIT(traverse_module_state->__pyx_n_s_shape);
4937 : Py_VISIT(traverse_module_state->__pyx_n_s_signatures);
4938 : Py_VISIT(traverse_module_state->__pyx_n_s_size);
4939 : Py_VISIT(traverse_module_state->__pyx_n_s_spec);
4940 : Py_VISIT(traverse_module_state->__pyx_n_s_split);
4941 : Py_VISIT(traverse_module_state->__pyx_n_s_start);
4942 : Py_VISIT(traverse_module_state->__pyx_n_s_startrow);
4943 : Py_VISIT(traverse_module_state->__pyx_n_s_step);
4944 : Py_VISIT(traverse_module_state->__pyx_n_s_stop);
4945 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
4946 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4947 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
4948 : Py_VISIT(traverse_module_state->__pyx_n_s_strides_c1);
4949 : Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
4950 : Py_VISIT(traverse_module_state->__pyx_n_s_strip);
4951 : Py_VISIT(traverse_module_state->__pyx_n_s_struct);
4952 : Py_VISIT(traverse_module_state->__pyx_n_s_sys);
4953 : Py_VISIT(traverse_module_state->__pyx_n_s_t);
4954 : Py_VISIT(traverse_module_state->__pyx_n_s_t_2);
4955 : Py_VISIT(traverse_module_state->__pyx_n_s_td);
4956 : Py_VISIT(traverse_module_state->__pyx_n_s_test);
4957 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4958 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4959 : Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
4960 : Py_VISIT(traverse_module_state->__pyx_n_s_update);
4961 : Py_VISIT(traverse_module_state->__pyx_n_s_values);
4962 : Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
4963 : Py_VISIT(traverse_module_state->__pyx_n_s_volume);
4964 : Py_VISIT(traverse_module_state->__pyx_n_s_w);
4965 : Py_VISIT(traverse_module_state->__pyx_kp_u_with_xv);
4966 : Py_VISIT(traverse_module_state->__pyx_n_s_work);
4967 : Py_VISIT(traverse_module_state->__pyx_n_s_wrk);
4968 : Py_VISIT(traverse_module_state->__pyx_n_s_wval);
4969 : Py_VISIT(traverse_module_state->__pyx_n_s_x);
4970 : Py_VISIT(traverse_module_state->__pyx_n_s_xd);
4971 : Py_VISIT(traverse_module_state->__pyx_n_s_xi);
4972 : Py_VISIT(traverse_module_state->__pyx_n_s_xp);
4973 : Py_VISIT(traverse_module_state->__pyx_n_s_xv);
4974 : Py_VISIT(traverse_module_state->__pyx_n_s_xval);
4975 : Py_VISIT(traverse_module_state->__pyx_n_s_xvals);
4976 : Py_VISIT(traverse_module_state->__pyx_n_s_y);
4977 : Py_VISIT(traverse_module_state->__pyx_kp_u_y_shape);
4978 : Py_VISIT(traverse_module_state->__pyx_n_s_zeros);
4979 : Py_VISIT(traverse_module_state->__pyx_int_0);
4980 : Py_VISIT(traverse_module_state->__pyx_int_1);
4981 : Py_VISIT(traverse_module_state->__pyx_int_2);
4982 : Py_VISIT(traverse_module_state->__pyx_int_3);
4983 : Py_VISIT(traverse_module_state->__pyx_int_5);
4984 : Py_VISIT(traverse_module_state->__pyx_int_112105877);
4985 : Py_VISIT(traverse_module_state->__pyx_int_136983863);
4986 : Py_VISIT(traverse_module_state->__pyx_int_184977713);
4987 : Py_VISIT(traverse_module_state->__pyx_int_neg_1);
4988 : Py_VISIT(traverse_module_state->__pyx_int_neg_101);
4989 : Py_VISIT(traverse_module_state->__pyx_slice__5);
4990 : Py_VISIT(traverse_module_state->__pyx_tuple__4);
4991 : Py_VISIT(traverse_module_state->__pyx_tuple__8);
4992 : Py_VISIT(traverse_module_state->__pyx_tuple__9);
4993 : Py_VISIT(traverse_module_state->__pyx_tuple__10);
4994 : Py_VISIT(traverse_module_state->__pyx_tuple__11);
4995 : Py_VISIT(traverse_module_state->__pyx_tuple__12);
4996 : Py_VISIT(traverse_module_state->__pyx_tuple__15);
4997 : Py_VISIT(traverse_module_state->__pyx_tuple__16);
4998 : Py_VISIT(traverse_module_state->__pyx_tuple__17);
4999 : Py_VISIT(traverse_module_state->__pyx_tuple__18);
5000 : Py_VISIT(traverse_module_state->__pyx_tuple__19);
5001 : Py_VISIT(traverse_module_state->__pyx_tuple__20);
5002 : Py_VISIT(traverse_module_state->__pyx_tuple__21);
5003 : Py_VISIT(traverse_module_state->__pyx_tuple__22);
5004 : Py_VISIT(traverse_module_state->__pyx_tuple__23);
5005 : Py_VISIT(traverse_module_state->__pyx_tuple__24);
5006 : Py_VISIT(traverse_module_state->__pyx_tuple__25);
5007 : Py_VISIT(traverse_module_state->__pyx_tuple__26);
5008 : Py_VISIT(traverse_module_state->__pyx_tuple__28);
5009 : Py_VISIT(traverse_module_state->__pyx_tuple__30);
5010 : Py_VISIT(traverse_module_state->__pyx_tuple__32);
5011 : Py_VISIT(traverse_module_state->__pyx_tuple__34);
5012 : Py_VISIT(traverse_module_state->__pyx_tuple__36);
5013 : Py_VISIT(traverse_module_state->__pyx_tuple__38);
5014 : Py_VISIT(traverse_module_state->__pyx_tuple__40);
5015 : Py_VISIT(traverse_module_state->__pyx_tuple__42);
5016 : Py_VISIT(traverse_module_state->__pyx_tuple__44);
5017 : Py_VISIT(traverse_module_state->__pyx_tuple__46);
5018 : Py_VISIT(traverse_module_state->__pyx_tuple__48);
5019 : Py_VISIT(traverse_module_state->__pyx_tuple__50);
5020 : Py_VISIT(traverse_module_state->__pyx_codeobj__27);
5021 : Py_VISIT(traverse_module_state->__pyx_codeobj__29);
5022 : Py_VISIT(traverse_module_state->__pyx_codeobj__31);
5023 : Py_VISIT(traverse_module_state->__pyx_codeobj__33);
5024 : Py_VISIT(traverse_module_state->__pyx_codeobj__35);
5025 : Py_VISIT(traverse_module_state->__pyx_codeobj__37);
5026 : Py_VISIT(traverse_module_state->__pyx_codeobj__39);
5027 : Py_VISIT(traverse_module_state->__pyx_codeobj__41);
5028 : Py_VISIT(traverse_module_state->__pyx_codeobj__43);
5029 : Py_VISIT(traverse_module_state->__pyx_codeobj__45);
5030 : Py_VISIT(traverse_module_state->__pyx_codeobj__47);
5031 : Py_VISIT(traverse_module_state->__pyx_codeobj__49);
5032 : Py_VISIT(traverse_module_state->__pyx_codeobj__51);
5033 : return 0;
5034 : }
5035 : #endif
5036 : /* #### Code section: module_state_defines ### */
5037 : #define __pyx_d __pyx_mstate_global->__pyx_d
5038 : #define __pyx_b __pyx_mstate_global->__pyx_b
5039 : #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
5040 : #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
5041 : #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
5042 : #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
5043 : #ifdef __Pyx_CyFunction_USED
5044 : #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
5045 : #endif
5046 : #ifdef __Pyx_FusedFunction_USED
5047 : #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
5048 : #endif
5049 : #ifdef __Pyx_Generator_USED
5050 : #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
5051 : #endif
5052 : #ifdef __Pyx_IterableCoroutine_USED
5053 : #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
5054 : #endif
5055 : #ifdef __Pyx_Coroutine_USED
5056 : #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
5057 : #endif
5058 : #ifdef __Pyx_Coroutine_USED
5059 : #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
5060 : #endif
5061 : #if CYTHON_USE_MODULE_STATE
5062 : #endif
5063 : #if CYTHON_USE_MODULE_STATE
5064 : #endif
5065 : #if CYTHON_USE_MODULE_STATE
5066 : #endif
5067 : #if CYTHON_USE_MODULE_STATE
5068 : #endif
5069 : #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
5070 : #if CYTHON_USE_MODULE_STATE
5071 : #endif
5072 : #if CYTHON_USE_MODULE_STATE
5073 : #endif
5074 : #if CYTHON_USE_MODULE_STATE
5075 : #endif
5076 : #if CYTHON_USE_MODULE_STATE
5077 : #endif
5078 : #if CYTHON_USE_MODULE_STATE
5079 : #endif
5080 : #define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
5081 : #define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
5082 : #define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
5083 : #define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
5084 : #define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
5085 : #define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
5086 : #define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
5087 : #define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
5088 : #define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
5089 : #define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
5090 : #define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
5091 : #define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
5092 : #define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
5093 : #define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
5094 : #define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
5095 : #if CYTHON_USE_MODULE_STATE
5096 : #endif
5097 : #if CYTHON_USE_MODULE_STATE
5098 : #endif
5099 : #if CYTHON_USE_MODULE_STATE
5100 : #endif
5101 : #if CYTHON_USE_MODULE_STATE
5102 : #endif
5103 : #if CYTHON_USE_MODULE_STATE
5104 : #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
5105 : #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
5106 : #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
5107 : #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
5108 : #endif
5109 : #define __pyx_array_type __pyx_mstate_global->__pyx_array_type
5110 : #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
5111 : #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
5112 : #define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
5113 : #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
5114 : #define __pyx_n_s_A __pyx_mstate_global->__pyx_n_s_A
5115 : #define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
5116 : #define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
5117 : #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
5118 : #define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
5119 : #define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
5120 : #define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
5121 : #define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
5122 : #define __pyx_kp_u_Cannot_do_derivative_order_s __pyx_mstate_global->__pyx_kp_u_Cannot_do_derivative_order_s
5123 : #define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
5124 : #define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
5125 : #define __pyx_kp_u_D_points __pyx_mstate_global->__pyx_kp_u_D_points
5126 : #define __pyx_kp_u_D_space_got __pyx_mstate_global->__pyx_kp_u_D_space_got
5127 : #define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
5128 : #define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
5129 : #define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
5130 : #define __pyx_kp_u_Evaluate_the_k_1_B_splines_which __pyx_mstate_global->__pyx_kp_u_Evaluate_the_k_1_B_splines_which
5131 : #define __pyx_kp_u_Expacted_data_points_in __pyx_mstate_global->__pyx_kp_u_Expacted_data_points_in
5132 : #define __pyx_kp_s_Expected_at_least_d_argument_s_g __pyx_mstate_global->__pyx_kp_s_Expected_at_least_d_argument_s_g
5133 : #define __pyx_kp_s_Function_call_with_ambiguous_arg __pyx_mstate_global->__pyx_kp_s_Function_call_with_ambiguous_arg
5134 : #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
5135 : #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
5136 : #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
5137 : #define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
5138 : #define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
5139 : #define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
5140 : #define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
5141 : #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
5142 : #define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
5143 : #define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
5144 : #define __pyx_kp_s_No_matching_signature_found __pyx_mstate_global->__pyx_kp_s_No_matching_signature_found
5145 : #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError
5146 : #define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
5147 : #define __pyx_kp_u_Out_of_bounds_in_d __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_in_d
5148 : #define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
5149 : #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
5150 : #define __pyx_n_s_R __pyx_mstate_global->__pyx_n_s_R
5151 : #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
5152 : #define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
5153 : #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
5154 : #define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
5155 : #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
5156 : #define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
5157 : #define __pyx_kp_s__13 __pyx_mstate_global->__pyx_kp_s__13
5158 : #define __pyx_kp_s__14 __pyx_mstate_global->__pyx_kp_s__14
5159 : #define __pyx_kp_u__14 __pyx_mstate_global->__pyx_kp_u__14
5160 : #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
5161 : #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
5162 : #define __pyx_n_s__52 __pyx_mstate_global->__pyx_n_s__52
5163 : #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
5164 : #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
5165 : #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a
5166 : #define __pyx_n_s_ab __pyx_mstate_global->__pyx_n_s_ab
5167 : #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
5168 : #define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
5169 : #define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
5170 : #define __pyx_kp_u_and_out_shape_1 __pyx_mstate_global->__pyx_kp_u_and_out_shape_1
5171 : #define __pyx_n_s_arange __pyx_mstate_global->__pyx_n_s_arange
5172 : #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args
5173 : #define __pyx_n_s_asarray __pyx_mstate_global->__pyx_n_s_asarray
5174 : #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
5175 : #define __pyx_n_s_b __pyx_mstate_global->__pyx_n_s_b
5176 : #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
5177 : #define __pyx_n_s_bbb __pyx_mstate_global->__pyx_n_s_bbb
5178 : #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
5179 : #define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
5180 : #define __pyx_n_s_c1r __pyx_mstate_global->__pyx_n_s_c1r
5181 : #define __pyx_n_s_ci __pyx_mstate_global->__pyx_n_s_ci
5182 : #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
5183 : #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
5184 : #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
5185 : #define __pyx_n_s_clmn __pyx_mstate_global->__pyx_n_s_clmn
5186 : #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
5187 : #define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
5188 : #define __pyx_n_s_colloc __pyx_mstate_global->__pyx_n_s_colloc
5189 : #define __pyx_n_s_colloc_nd __pyx_mstate_global->__pyx_n_s_colloc_nd
5190 : #define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
5191 : #define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
5192 : #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
5193 : #define __pyx_n_s_csr_data __pyx_mstate_global->__pyx_n_s_csr_data
5194 : #define __pyx_n_s_csr_indices __pyx_mstate_global->__pyx_n_s_csr_indices
5195 : #define __pyx_n_s_csr_indptr __pyx_mstate_global->__pyx_n_s_csr_indptr
5196 : #define __pyx_n_s_cstrides __pyx_mstate_global->__pyx_n_s_cstrides
5197 : #define __pyx_n_s_d __pyx_mstate_global->__pyx_n_s_d
5198 : #define __pyx_n_s_data __pyx_mstate_global->__pyx_n_s_data
5199 : #define __pyx_n_s_data_matrix __pyx_mstate_global->__pyx_n_s_data_matrix
5200 : #define __pyx_n_s_defaults __pyx_mstate_global->__pyx_n_s_defaults
5201 : #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
5202 : #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
5203 : #define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
5204 : #define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
5205 : #define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty
5206 : #define __pyx_n_s_empty_like __pyx_mstate_global->__pyx_n_s_empty_like
5207 : #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
5208 : #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
5209 : #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
5210 : #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
5211 : #define __pyx_n_s_evaluate_all_bspl __pyx_mstate_global->__pyx_n_s_evaluate_all_bspl
5212 : #define __pyx_kp_u_evaluate_all_bspl_line_181 __pyx_mstate_global->__pyx_kp_u_evaluate_all_bspl_line_181
5213 : #define __pyx_n_s_evaluate_ndbspline __pyx_mstate_global->__pyx_n_s_evaluate_ndbspline
5214 : #define __pyx_n_s_evaluate_spline __pyx_mstate_global->__pyx_n_s_evaluate_spline
5215 : #define __pyx_n_s_extrapolate __pyx_mstate_global->__pyx_n_s_extrapolate
5216 : #define __pyx_n_s_factor __pyx_mstate_global->__pyx_n_s_factor
5217 : #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
5218 : #define __pyx_n_s_float64 __pyx_mstate_global->__pyx_n_s_float64
5219 : #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
5220 : #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
5221 : #define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
5222 : #define __pyx_n_s_fpback __pyx_mstate_global->__pyx_n_s_fpback
5223 : #define __pyx_n_s_fpknot __pyx_mstate_global->__pyx_n_s_fpknot
5224 : #define __pyx_n_s_fused_sigindex __pyx_mstate_global->__pyx_n_s_fused_sigindex
5225 : #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
5226 : #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
5227 : #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
5228 : #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
5229 : #define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
5230 : #define __pyx_kp_s_home_czgdp18079_Quansight_scipy __pyx_mstate_global->__pyx_kp_s_home_czgdp18079_Quansight_scipy
5231 : #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
5232 : #define __pyx_n_s_i_c __pyx_mstate_global->__pyx_n_s_i_c
5233 : #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
5234 : #define __pyx_n_s_idx __pyx_mstate_global->__pyx_n_s_idx
5235 : #define __pyx_n_s_idx_b __pyx_mstate_global->__pyx_n_s_idx_b
5236 : #define __pyx_n_s_idx_c __pyx_mstate_global->__pyx_n_s_idx_c
5237 : #define __pyx_n_s_idx_cflat __pyx_mstate_global->__pyx_n_s_idx_cflat
5238 : #define __pyx_n_s_idx_cflat_base __pyx_mstate_global->__pyx_n_s_idx_cflat_base
5239 : #define __pyx_n_s_iflat __pyx_mstate_global->__pyx_n_s_iflat
5240 : #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
5241 : #define __pyx_n_s_ind __pyx_mstate_global->__pyx_n_s_ind
5242 : #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
5243 : #define __pyx_n_s_indices __pyx_mstate_global->__pyx_n_s_indices
5244 : #define __pyx_n_s_indices_k1d __pyx_mstate_global->__pyx_n_s_indices_k1d
5245 : #define __pyx_n_s_indices_k1d_2 __pyx_mstate_global->__pyx_n_s_indices_k1d_2
5246 : #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
5247 : #define __pyx_n_s_int64 __pyx_mstate_global->__pyx_n_s_int64
5248 : #define __pyx_n_s_interval __pyx_mstate_global->__pyx_n_s_interval
5249 : #define __pyx_n_s_intp __pyx_mstate_global->__pyx_n_s_intp
5250 : #define __pyx_n_s_ip __pyx_mstate_global->__pyx_n_s_ip
5251 : #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
5252 : #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
5253 : #define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
5254 : #define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
5255 : #define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
5256 : #define __pyx_n_s_jp __pyx_mstate_global->__pyx_n_s_jp
5257 : #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k
5258 : #define __pyx_n_s_kd __pyx_mstate_global->__pyx_n_s_kd
5259 : #define __pyx_n_s_kind __pyx_mstate_global->__pyx_n_s_kind
5260 : #define __pyx_n_s_kl __pyx_mstate_global->__pyx_n_s_kl
5261 : #define __pyx_n_s_ku __pyx_mstate_global->__pyx_n_s_ku
5262 : #define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs
5263 : #define __pyx_n_s_left __pyx_mstate_global->__pyx_n_s_left
5264 : #define __pyx_kp_u_len_residuals __pyx_mstate_global->__pyx_kp_u_len_residuals
5265 : #define __pyx_n_s_len_t __pyx_mstate_global->__pyx_n_s_len_t
5266 : #define __pyx_kp_u_len_w __pyx_mstate_global->__pyx_kp_u_len_w
5267 : #define __pyx_kp_u_len_x __pyx_mstate_global->__pyx_kp_u_len_x
5268 : #define __pyx_kp_u_len_x_2 __pyx_mstate_global->__pyx_kp_u_len_x_2
5269 : #define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m
5270 : #define __pyx_kp_u_m_2 __pyx_mstate_global->__pyx_kp_u_m_2
5271 : #define __pyx_kp_u_m_3 __pyx_mstate_global->__pyx_kp_u_m_3
5272 : #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
5273 : #define __pyx_n_s_make_design_matrix __pyx_mstate_global->__pyx_n_s_make_design_matrix
5274 : #define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max
5275 : #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
5276 : #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
5277 : #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n
5278 : #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
5279 : #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
5280 : #define __pyx_n_s_nc __pyx_mstate_global->__pyx_n_s_nc
5281 : #define __pyx_kp_u_nc_2 __pyx_mstate_global->__pyx_kp_u_nc_2
5282 : #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
5283 : #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
5284 : #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
5285 : #define __pyx_n_s_norm_eq_lsq __pyx_mstate_global->__pyx_n_s_norm_eq_lsq
5286 : #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
5287 : #define __pyx_n_s_npy_int32 __pyx_mstate_global->__pyx_n_s_npy_int32
5288 : #define __pyx_n_s_npy_int64 __pyx_mstate_global->__pyx_n_s_npy_int64
5289 : #define __pyx_n_s_nu __pyx_mstate_global->__pyx_n_s_nu
5290 : #define __pyx_n_s_num_c_tr __pyx_mstate_global->__pyx_n_s_num_c_tr
5291 : #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
5292 : #define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
5293 : #define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
5294 : #define __pyx_n_s_nz __pyx_mstate_global->__pyx_n_s_nz
5295 : #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
5296 : #define __pyx_n_s_offset __pyx_mstate_global->__pyx_n_s_offset
5297 : #define __pyx_n_s_ones __pyx_mstate_global->__pyx_n_s_ones
5298 : #define __pyx_n_s_out __pyx_mstate_global->__pyx_n_s_out
5299 : #define __pyx_kp_u_out_and_c_are_inconsistent_num_c __pyx_mstate_global->__pyx_kp_u_out_and_c_are_inconsistent_num_c
5300 : #define __pyx_kp_u_out_and_c_have_incompatible_shap __pyx_mstate_global->__pyx_kp_u_out_and_c_have_incompatible_shap
5301 : #define __pyx_kp_u_out_and_xi_are_inconsistent_expe __pyx_mstate_global->__pyx_kp_u_out_and_xi_are_inconsistent_expe
5302 : #define __pyx_kp_u_out_and_xp_have_incompatible_sha __pyx_mstate_global->__pyx_kp_u_out_and_xp_have_incompatible_sha
5303 : #define __pyx_n_s_out_of_bounds __pyx_mstate_global->__pyx_n_s_out_of_bounds
5304 : #define __pyx_kp_u_output_values_got __pyx_mstate_global->__pyx_kp_u_output_values_got
5305 : #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
5306 : #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
5307 : #define __pyx_n_s_prev_l __pyx_mstate_global->__pyx_n_s_prev_l
5308 : #define __pyx_n_s_py_find_interval __pyx_mstate_global->__pyx_n_s_py_find_interval
5309 : #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
5310 : #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
5311 : #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
5312 : #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
5313 : #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
5314 : #define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
5315 : #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
5316 : #define __pyx_n_s_qr_reduce __pyx_mstate_global->__pyx_n_s_qr_reduce
5317 : #define __pyx_n_s_r __pyx_mstate_global->__pyx_n_s_r
5318 : #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
5319 : #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
5320 : #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
5321 : #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
5322 : #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
5323 : #define __pyx_n_s_residuals __pyx_mstate_global->__pyx_n_s_residuals
5324 : #define __pyx_n_s_rhs __pyx_mstate_global->__pyx_n_s_rhs
5325 : #define __pyx_n_s_row __pyx_mstate_global->__pyx_n_s_row
5326 : #define __pyx_n_s_s __pyx_mstate_global->__pyx_n_s_s
5327 : #define __pyx_n_s_scipy_interpolate__bspl __pyx_mstate_global->__pyx_n_s_scipy_interpolate__bspl
5328 : #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
5329 : #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
5330 : #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
5331 : #define __pyx_n_s_signatures __pyx_mstate_global->__pyx_n_s_signatures
5332 : #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
5333 : #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
5334 : #define __pyx_n_s_split __pyx_mstate_global->__pyx_n_s_split
5335 : #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
5336 : #define __pyx_n_s_startrow __pyx_mstate_global->__pyx_n_s_startrow
5337 : #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
5338 : #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
5339 : #define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
5340 : #define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
5341 : #define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
5342 : #define __pyx_n_s_strides_c1 __pyx_mstate_global->__pyx_n_s_strides_c1
5343 : #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
5344 : #define __pyx_n_s_strip __pyx_mstate_global->__pyx_n_s_strip
5345 : #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
5346 : #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
5347 : #define __pyx_n_s_t __pyx_mstate_global->__pyx_n_s_t
5348 : #define __pyx_n_s_t_2 __pyx_mstate_global->__pyx_n_s_t_2
5349 : #define __pyx_n_s_td __pyx_mstate_global->__pyx_n_s_td
5350 : #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
5351 : #define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
5352 : #define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
5353 : #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
5354 : #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
5355 : #define __pyx_n_s_values __pyx_mstate_global->__pyx_n_s_values
5356 : #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
5357 : #define __pyx_n_s_volume __pyx_mstate_global->__pyx_n_s_volume
5358 : #define __pyx_n_s_w __pyx_mstate_global->__pyx_n_s_w
5359 : #define __pyx_kp_u_with_xv __pyx_mstate_global->__pyx_kp_u_with_xv
5360 : #define __pyx_n_s_work __pyx_mstate_global->__pyx_n_s_work
5361 : #define __pyx_n_s_wrk __pyx_mstate_global->__pyx_n_s_wrk
5362 : #define __pyx_n_s_wval __pyx_mstate_global->__pyx_n_s_wval
5363 : #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x
5364 : #define __pyx_n_s_xd __pyx_mstate_global->__pyx_n_s_xd
5365 : #define __pyx_n_s_xi __pyx_mstate_global->__pyx_n_s_xi
5366 : #define __pyx_n_s_xp __pyx_mstate_global->__pyx_n_s_xp
5367 : #define __pyx_n_s_xv __pyx_mstate_global->__pyx_n_s_xv
5368 : #define __pyx_n_s_xval __pyx_mstate_global->__pyx_n_s_xval
5369 : #define __pyx_n_s_xvals __pyx_mstate_global->__pyx_n_s_xvals
5370 : #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y
5371 : #define __pyx_kp_u_y_shape __pyx_mstate_global->__pyx_kp_u_y_shape
5372 : #define __pyx_n_s_zeros __pyx_mstate_global->__pyx_n_s_zeros
5373 : #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
5374 : #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
5375 : #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
5376 : #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
5377 : #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5
5378 : #define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
5379 : #define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
5380 : #define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
5381 : #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
5382 : #define __pyx_int_neg_101 __pyx_mstate_global->__pyx_int_neg_101
5383 : #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5
5384 : #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
5385 : #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
5386 : #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
5387 : #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
5388 : #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
5389 : #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
5390 : #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
5391 : #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
5392 : #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
5393 : #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
5394 : #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
5395 : #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
5396 : #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
5397 : #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
5398 : #define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
5399 : #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
5400 : #define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
5401 : #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
5402 : #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
5403 : #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
5404 : #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32
5405 : #define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
5406 : #define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
5407 : #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38
5408 : #define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40
5409 : #define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42
5410 : #define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
5411 : #define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
5412 : #define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
5413 : #define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50
5414 : #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27
5415 : #define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29
5416 : #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31
5417 : #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33
5418 : #define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35
5419 : #define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37
5420 : #define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39
5421 : #define __pyx_codeobj__41 __pyx_mstate_global->__pyx_codeobj__41
5422 : #define __pyx_codeobj__43 __pyx_mstate_global->__pyx_codeobj__43
5423 : #define __pyx_codeobj__45 __pyx_mstate_global->__pyx_codeobj__45
5424 : #define __pyx_codeobj__47 __pyx_mstate_global->__pyx_codeobj__47
5425 : #define __pyx_codeobj__49 __pyx_mstate_global->__pyx_codeobj__49
5426 : #define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51
5427 : /* #### Code section: module_code ### */
5428 :
5429 : /* "carray.to_py":114
5430 : *
5431 : * @cname("__Pyx_carray_to_py_Py_ssize_t")
5432 : * cdef inline list __Pyx_carray_to_py_Py_ssize_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
5433 : * cdef size_t i
5434 : * cdef object value
5435 : */
5436 :
5437 0 : static CYTHON_INLINE PyObject *__Pyx_carray_to_py_Py_ssize_t(Py_ssize_t *__pyx_v_v, Py_ssize_t __pyx_v_length) {
5438 0 : size_t __pyx_v_i;
5439 0 : PyObject *__pyx_v_value = 0;
5440 0 : PyObject *__pyx_v_l = NULL;
5441 0 : PyObject *__pyx_r = NULL;
5442 : __Pyx_RefNannyDeclarations
5443 0 : PyObject *__pyx_t_1 = NULL;
5444 0 : size_t __pyx_t_2;
5445 0 : size_t __pyx_t_3;
5446 0 : size_t __pyx_t_4;
5447 0 : int __pyx_lineno = 0;
5448 0 : const char *__pyx_filename = NULL;
5449 0 : int __pyx_clineno = 0;
5450 0 : __Pyx_RefNannySetupContext("__Pyx_carray_to_py_Py_ssize_t", 1);
5451 :
5452 : /* "carray.to_py":117
5453 : * cdef size_t i
5454 : * cdef object value
5455 : * l = PyList_New(length) # <<<<<<<<<<<<<<
5456 : * for i in range(<size_t>length):
5457 : * value = v[i]
5458 : */
5459 0 : __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
5460 0 : __Pyx_GOTREF(__pyx_t_1);
5461 0 : __pyx_v_l = ((PyObject*)__pyx_t_1);
5462 0 : __pyx_t_1 = 0;
5463 :
5464 : /* "carray.to_py":118
5465 : * cdef object value
5466 : * l = PyList_New(length)
5467 : * for i in range(<size_t>length): # <<<<<<<<<<<<<<
5468 : * value = v[i]
5469 : * Py_INCREF(value)
5470 : */
5471 0 : __pyx_t_2 = ((size_t)__pyx_v_length);
5472 0 : __pyx_t_3 = __pyx_t_2;
5473 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
5474 0 : __pyx_v_i = __pyx_t_4;
5475 :
5476 : /* "carray.to_py":119
5477 : * l = PyList_New(length)
5478 : * for i in range(<size_t>length):
5479 : * value = v[i] # <<<<<<<<<<<<<<
5480 : * Py_INCREF(value)
5481 : * PyList_SET_ITEM(l, i, value)
5482 : */
5483 0 : __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
5484 0 : __Pyx_GOTREF(__pyx_t_1);
5485 0 : __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
5486 0 : __pyx_t_1 = 0;
5487 :
5488 : /* "carray.to_py":120
5489 : * for i in range(<size_t>length):
5490 : * value = v[i]
5491 : * Py_INCREF(value) # <<<<<<<<<<<<<<
5492 : * PyList_SET_ITEM(l, i, value)
5493 : * return l
5494 : */
5495 0 : Py_INCREF(__pyx_v_value);
5496 :
5497 : /* "carray.to_py":121
5498 : * value = v[i]
5499 : * Py_INCREF(value)
5500 : * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<<
5501 : * return l
5502 : *
5503 : */
5504 0 : PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
5505 : }
5506 :
5507 : /* "carray.to_py":122
5508 : * Py_INCREF(value)
5509 : * PyList_SET_ITEM(l, i, value)
5510 : * return l # <<<<<<<<<<<<<<
5511 : *
5512 : *
5513 : */
5514 0 : __Pyx_XDECREF(__pyx_r);
5515 0 : __Pyx_INCREF(__pyx_v_l);
5516 0 : __pyx_r = __pyx_v_l;
5517 0 : goto __pyx_L0;
5518 :
5519 : /* "carray.to_py":114
5520 : *
5521 : * @cname("__Pyx_carray_to_py_Py_ssize_t")
5522 : * cdef inline list __Pyx_carray_to_py_Py_ssize_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
5523 : * cdef size_t i
5524 : * cdef object value
5525 : */
5526 :
5527 : /* function exit code */
5528 0 : __pyx_L1_error:;
5529 0 : __Pyx_XDECREF(__pyx_t_1);
5530 0 : __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_Py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
5531 0 : __pyx_r = 0;
5532 0 : __pyx_L0:;
5533 0 : __Pyx_XDECREF(__pyx_v_value);
5534 0 : __Pyx_XDECREF(__pyx_v_l);
5535 0 : __Pyx_XGIVEREF(__pyx_r);
5536 0 : __Pyx_RefNannyFinishContext();
5537 0 : return __pyx_r;
5538 : }
5539 :
5540 : /* "carray.to_py":126
5541 : *
5542 : * @cname("__Pyx_carray_to_tuple_Py_ssize_t")
5543 : * cdef inline tuple __Pyx_carray_to_tuple_Py_ssize_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
5544 : * cdef size_t i
5545 : * cdef object value
5546 : */
5547 :
5548 : static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_Py_ssize_t(Py_ssize_t *__pyx_v_v, Py_ssize_t __pyx_v_length) {
5549 : size_t __pyx_v_i;
5550 : PyObject *__pyx_v_value = 0;
5551 : PyObject *__pyx_v_t = NULL;
5552 : PyObject *__pyx_r = NULL;
5553 : __Pyx_RefNannyDeclarations
5554 : PyObject *__pyx_t_1 = NULL;
5555 : size_t __pyx_t_2;
5556 : size_t __pyx_t_3;
5557 : size_t __pyx_t_4;
5558 : int __pyx_lineno = 0;
5559 : const char *__pyx_filename = NULL;
5560 : int __pyx_clineno = 0;
5561 : __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_Py_ssize_t", 1);
5562 :
5563 : /* "carray.to_py":129
5564 : * cdef size_t i
5565 : * cdef object value
5566 : * t = PyTuple_New(length) # <<<<<<<<<<<<<<
5567 : * for i in range(<size_t>length):
5568 : * value = v[i]
5569 : */
5570 : __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
5571 : __Pyx_GOTREF(__pyx_t_1);
5572 : __pyx_v_t = ((PyObject*)__pyx_t_1);
5573 : __pyx_t_1 = 0;
5574 :
5575 : /* "carray.to_py":130
5576 : * cdef object value
5577 : * t = PyTuple_New(length)
5578 : * for i in range(<size_t>length): # <<<<<<<<<<<<<<
5579 : * value = v[i]
5580 : * Py_INCREF(value)
5581 : */
5582 : __pyx_t_2 = ((size_t)__pyx_v_length);
5583 : __pyx_t_3 = __pyx_t_2;
5584 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
5585 : __pyx_v_i = __pyx_t_4;
5586 :
5587 : /* "carray.to_py":131
5588 : * t = PyTuple_New(length)
5589 : * for i in range(<size_t>length):
5590 : * value = v[i] # <<<<<<<<<<<<<<
5591 : * Py_INCREF(value)
5592 : * PyTuple_SET_ITEM(t, i, value)
5593 : */
5594 : __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
5595 : __Pyx_GOTREF(__pyx_t_1);
5596 : __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
5597 : __pyx_t_1 = 0;
5598 :
5599 : /* "carray.to_py":132
5600 : * for i in range(<size_t>length):
5601 : * value = v[i]
5602 : * Py_INCREF(value) # <<<<<<<<<<<<<<
5603 : * PyTuple_SET_ITEM(t, i, value)
5604 : * return t
5605 : */
5606 : Py_INCREF(__pyx_v_value);
5607 :
5608 : /* "carray.to_py":133
5609 : * value = v[i]
5610 : * Py_INCREF(value)
5611 : * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<<
5612 : * return t
5613 : */
5614 : PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
5615 : }
5616 :
5617 : /* "carray.to_py":134
5618 : * Py_INCREF(value)
5619 : * PyTuple_SET_ITEM(t, i, value)
5620 : * return t # <<<<<<<<<<<<<<
5621 : */
5622 : __Pyx_XDECREF(__pyx_r);
5623 : __Pyx_INCREF(__pyx_v_t);
5624 : __pyx_r = __pyx_v_t;
5625 : goto __pyx_L0;
5626 :
5627 : /* "carray.to_py":126
5628 : *
5629 : * @cname("__Pyx_carray_to_tuple_Py_ssize_t")
5630 : * cdef inline tuple __Pyx_carray_to_tuple_Py_ssize_t(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
5631 : * cdef size_t i
5632 : * cdef object value
5633 : */
5634 :
5635 : /* function exit code */
5636 : __pyx_L1_error:;
5637 : __Pyx_XDECREF(__pyx_t_1);
5638 : __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_Py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
5639 : __pyx_r = 0;
5640 : __pyx_L0:;
5641 : __Pyx_XDECREF(__pyx_v_value);
5642 : __Pyx_XDECREF(__pyx_v_t);
5643 : __Pyx_XGIVEREF(__pyx_r);
5644 : __Pyx_RefNannyFinishContext();
5645 : return __pyx_r;
5646 : }
5647 :
5648 : /* "View.MemoryView":131
5649 : * cdef bint dtype_is_object
5650 : *
5651 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5652 : * mode="c", bint allocate_buffer=True):
5653 : *
5654 : */
5655 :
5656 : /* Python wrapper */
5657 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5658 0 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5659 0 : PyObject *__pyx_v_shape = 0;
5660 0 : Py_ssize_t __pyx_v_itemsize;
5661 0 : PyObject *__pyx_v_format = 0;
5662 0 : PyObject *__pyx_v_mode = 0;
5663 0 : int __pyx_v_allocate_buffer;
5664 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
5665 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5666 0 : PyObject* values[5] = {0,0,0,0,0};
5667 0 : int __pyx_lineno = 0;
5668 0 : const char *__pyx_filename = NULL;
5669 0 : int __pyx_clineno = 0;
5670 0 : int __pyx_r;
5671 : __Pyx_RefNannyDeclarations
5672 0 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
5673 : #if CYTHON_ASSUME_SAFE_MACROS
5674 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
5675 : #else
5676 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
5677 : #endif
5678 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5679 0 : {
5680 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
5681 0 : values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c));
5682 0 : if (__pyx_kwds) {
5683 0 : Py_ssize_t kw_args;
5684 0 : switch (__pyx_nargs) {
5685 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
5686 0 : CYTHON_FALLTHROUGH;
5687 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
5688 0 : CYTHON_FALLTHROUGH;
5689 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
5690 0 : CYTHON_FALLTHROUGH;
5691 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
5692 0 : CYTHON_FALLTHROUGH;
5693 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
5694 0 : CYTHON_FALLTHROUGH;
5695 0 : case 0: break;
5696 0 : default: goto __pyx_L5_argtuple_error;
5697 : }
5698 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
5699 0 : switch (__pyx_nargs) {
5700 0 : case 0:
5701 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) {
5702 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
5703 0 : kw_args--;
5704 : }
5705 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5706 0 : else goto __pyx_L5_argtuple_error;
5707 0 : CYTHON_FALLTHROUGH;
5708 0 : case 1:
5709 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) {
5710 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
5711 0 : kw_args--;
5712 : }
5713 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5714 : else {
5715 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 131, __pyx_L3_error)
5716 : }
5717 0 : CYTHON_FALLTHROUGH;
5718 0 : case 2:
5719 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
5720 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
5721 0 : kw_args--;
5722 : }
5723 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5724 : else {
5725 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 131, __pyx_L3_error)
5726 : }
5727 0 : CYTHON_FALLTHROUGH;
5728 0 : case 3:
5729 0 : if (kw_args > 0) {
5730 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
5731 0 : if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
5732 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5733 : }
5734 0 : CYTHON_FALLTHROUGH;
5735 0 : case 4:
5736 0 : if (kw_args > 0) {
5737 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
5738 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
5739 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5740 : }
5741 : }
5742 0 : if (unlikely(kw_args > 0)) {
5743 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
5744 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 131, __pyx_L3_error)
5745 : }
5746 : } else {
5747 0 : switch (__pyx_nargs) {
5748 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
5749 0 : CYTHON_FALLTHROUGH;
5750 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
5751 0 : CYTHON_FALLTHROUGH;
5752 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
5753 0 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
5754 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
5755 0 : break;
5756 0 : default: goto __pyx_L5_argtuple_error;
5757 : }
5758 : }
5759 0 : __pyx_v_shape = ((PyObject*)values[0]);
5760 0 : __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
5761 0 : __pyx_v_format = values[2];
5762 0 : __pyx_v_mode = values[3];
5763 0 : if (values[4]) {
5764 0 : __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L3_error)
5765 : } else {
5766 :
5767 : /* "View.MemoryView":132
5768 : *
5769 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
5770 : * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
5771 : *
5772 : * cdef int idx
5773 : */
5774 : __pyx_v_allocate_buffer = ((int)1);
5775 : }
5776 : }
5777 0 : goto __pyx_L6_skip;
5778 0 : __pyx_L5_argtuple_error:;
5779 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error)
5780 0 : __pyx_L6_skip:;
5781 0 : goto __pyx_L4_argument_unpacking_done;
5782 0 : __pyx_L3_error:;
5783 0 : {
5784 0 : Py_ssize_t __pyx_temp;
5785 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5786 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
5787 : }
5788 : }
5789 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5790 : __Pyx_RefNannyFinishContext();
5791 : return -1;
5792 0 : __pyx_L4_argument_unpacking_done:;
5793 0 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 131, __pyx_L1_error)
5794 0 : if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
5795 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 131, __pyx_L1_error)
5796 : }
5797 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
5798 :
5799 : /* "View.MemoryView":131
5800 : * cdef bint dtype_is_object
5801 : *
5802 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5803 : * mode="c", bint allocate_buffer=True):
5804 : *
5805 : */
5806 :
5807 : /* function exit code */
5808 0 : goto __pyx_L0;
5809 : __pyx_L1_error:;
5810 : __pyx_r = -1;
5811 0 : __pyx_L0:;
5812 0 : {
5813 0 : Py_ssize_t __pyx_temp;
5814 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
5815 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
5816 : }
5817 : }
5818 : __Pyx_RefNannyFinishContext();
5819 : return __pyx_r;
5820 : }
5821 :
5822 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
5823 0 : int __pyx_v_idx;
5824 0 : Py_ssize_t __pyx_v_dim;
5825 0 : char __pyx_v_order;
5826 0 : int __pyx_r;
5827 : __Pyx_RefNannyDeclarations
5828 0 : Py_ssize_t __pyx_t_1;
5829 0 : int __pyx_t_2;
5830 0 : int __pyx_t_3;
5831 0 : PyObject *__pyx_t_4 = NULL;
5832 0 : PyObject *__pyx_t_5 = NULL;
5833 0 : PyObject *__pyx_t_6 = NULL;
5834 0 : unsigned int __pyx_t_7;
5835 0 : char *__pyx_t_8;
5836 0 : int __pyx_t_9;
5837 0 : Py_ssize_t __pyx_t_10;
5838 0 : Py_UCS4 __pyx_t_11;
5839 0 : int __pyx_lineno = 0;
5840 0 : const char *__pyx_filename = NULL;
5841 0 : int __pyx_clineno = 0;
5842 0 : __Pyx_RefNannySetupContext("__cinit__", 0);
5843 0 : __Pyx_INCREF(__pyx_v_format);
5844 :
5845 : /* "View.MemoryView":137
5846 : * cdef Py_ssize_t dim
5847 : *
5848 : * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
5849 : * self.itemsize = itemsize
5850 : *
5851 : */
5852 0 : if (unlikely(__pyx_v_shape == Py_None)) {
5853 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5854 0 : __PYX_ERR(1, 137, __pyx_L1_error)
5855 : }
5856 0 : __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 137, __pyx_L1_error)
5857 0 : __pyx_v_self->ndim = ((int)__pyx_t_1);
5858 :
5859 : /* "View.MemoryView":138
5860 : *
5861 : * self.ndim = <int> len(shape)
5862 : * self.itemsize = itemsize # <<<<<<<<<<<<<<
5863 : *
5864 : * if not self.ndim:
5865 : */
5866 0 : __pyx_v_self->itemsize = __pyx_v_itemsize;
5867 :
5868 : /* "View.MemoryView":140
5869 : * self.itemsize = itemsize
5870 : *
5871 : * if not self.ndim: # <<<<<<<<<<<<<<
5872 : * raise ValueError, "Empty shape tuple for cython.array"
5873 : *
5874 : */
5875 0 : __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
5876 0 : if (unlikely(__pyx_t_2)) {
5877 :
5878 : /* "View.MemoryView":141
5879 : *
5880 : * if not self.ndim:
5881 : * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
5882 : *
5883 : * if itemsize <= 0:
5884 : */
5885 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
5886 0 : __PYX_ERR(1, 141, __pyx_L1_error)
5887 :
5888 : /* "View.MemoryView":140
5889 : * self.itemsize = itemsize
5890 : *
5891 : * if not self.ndim: # <<<<<<<<<<<<<<
5892 : * raise ValueError, "Empty shape tuple for cython.array"
5893 : *
5894 : */
5895 : }
5896 :
5897 : /* "View.MemoryView":143
5898 : * raise ValueError, "Empty shape tuple for cython.array"
5899 : *
5900 : * if itemsize <= 0: # <<<<<<<<<<<<<<
5901 : * raise ValueError, "itemsize <= 0 for cython.array"
5902 : *
5903 : */
5904 0 : __pyx_t_2 = (__pyx_v_itemsize <= 0);
5905 0 : if (unlikely(__pyx_t_2)) {
5906 :
5907 : /* "View.MemoryView":144
5908 : *
5909 : * if itemsize <= 0:
5910 : * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
5911 : *
5912 : * if not isinstance(format, bytes):
5913 : */
5914 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
5915 0 : __PYX_ERR(1, 144, __pyx_L1_error)
5916 :
5917 : /* "View.MemoryView":143
5918 : * raise ValueError, "Empty shape tuple for cython.array"
5919 : *
5920 : * if itemsize <= 0: # <<<<<<<<<<<<<<
5921 : * raise ValueError, "itemsize <= 0 for cython.array"
5922 : *
5923 : */
5924 : }
5925 :
5926 : /* "View.MemoryView":146
5927 : * raise ValueError, "itemsize <= 0 for cython.array"
5928 : *
5929 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5930 : * format = format.encode('ASCII')
5931 : * self._format = format # keep a reference to the byte string
5932 : */
5933 0 : __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5934 0 : __pyx_t_3 = (!__pyx_t_2);
5935 0 : if (__pyx_t_3) {
5936 :
5937 : /* "View.MemoryView":147
5938 : *
5939 : * if not isinstance(format, bytes):
5940 : * format = format.encode('ASCII') # <<<<<<<<<<<<<<
5941 : * self._format = format # keep a reference to the byte string
5942 : * self.format = self._format
5943 : */
5944 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
5945 0 : __Pyx_GOTREF(__pyx_t_5);
5946 0 : __pyx_t_6 = NULL;
5947 0 : __pyx_t_7 = 0;
5948 : #if CYTHON_UNPACK_METHODS
5949 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
5950 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5951 0 : if (likely(__pyx_t_6)) {
5952 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5953 0 : __Pyx_INCREF(__pyx_t_6);
5954 0 : __Pyx_INCREF(function);
5955 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
5956 : __pyx_t_7 = 1;
5957 : }
5958 : }
5959 : #endif
5960 0 : {
5961 0 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
5962 0 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
5963 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5964 0 : if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
5965 0 : __Pyx_GOTREF(__pyx_t_4);
5966 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5967 : }
5968 0 : __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
5969 : __pyx_t_4 = 0;
5970 :
5971 : /* "View.MemoryView":146
5972 : * raise ValueError, "itemsize <= 0 for cython.array"
5973 : *
5974 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5975 : * format = format.encode('ASCII')
5976 : * self._format = format # keep a reference to the byte string
5977 : */
5978 : }
5979 :
5980 : /* "View.MemoryView":148
5981 : * if not isinstance(format, bytes):
5982 : * format = format.encode('ASCII')
5983 : * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
5984 : * self.format = self._format
5985 : *
5986 : */
5987 0 : if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(1, 148, __pyx_L1_error)
5988 0 : __pyx_t_4 = __pyx_v_format;
5989 0 : __Pyx_INCREF(__pyx_t_4);
5990 0 : __Pyx_GIVEREF(__pyx_t_4);
5991 0 : __Pyx_GOTREF(__pyx_v_self->_format);
5992 0 : __Pyx_DECREF(__pyx_v_self->_format);
5993 0 : __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
5994 0 : __pyx_t_4 = 0;
5995 :
5996 : /* "View.MemoryView":149
5997 : * format = format.encode('ASCII')
5998 : * self._format = format # keep a reference to the byte string
5999 : * self.format = self._format # <<<<<<<<<<<<<<
6000 : *
6001 : *
6002 : */
6003 0 : if (unlikely(__pyx_v_self->_format == Py_None)) {
6004 0 : PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
6005 0 : __PYX_ERR(1, 149, __pyx_L1_error)
6006 : }
6007 0 : __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
6008 0 : __pyx_v_self->format = __pyx_t_8;
6009 :
6010 : /* "View.MemoryView":152
6011 : *
6012 : *
6013 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
6014 : * self._strides = self._shape + self.ndim
6015 : *
6016 : */
6017 0 : __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
6018 :
6019 : /* "View.MemoryView":153
6020 : *
6021 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
6022 : * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
6023 : *
6024 : * if not self._shape:
6025 : */
6026 0 : __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
6027 :
6028 : /* "View.MemoryView":155
6029 : * self._strides = self._shape + self.ndim
6030 : *
6031 : * if not self._shape: # <<<<<<<<<<<<<<
6032 : * raise MemoryError, "unable to allocate shape and strides."
6033 : *
6034 : */
6035 0 : __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
6036 0 : if (unlikely(__pyx_t_3)) {
6037 :
6038 : /* "View.MemoryView":156
6039 : *
6040 : * if not self._shape:
6041 : * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
6042 : *
6043 : *
6044 : */
6045 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
6046 0 : __PYX_ERR(1, 156, __pyx_L1_error)
6047 :
6048 : /* "View.MemoryView":155
6049 : * self._strides = self._shape + self.ndim
6050 : *
6051 : * if not self._shape: # <<<<<<<<<<<<<<
6052 : * raise MemoryError, "unable to allocate shape and strides."
6053 : *
6054 : */
6055 : }
6056 :
6057 : /* "View.MemoryView":159
6058 : *
6059 : *
6060 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6061 : * if dim <= 0:
6062 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6063 : */
6064 0 : __pyx_t_9 = 0;
6065 0 : __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
6066 : __pyx_t_1 = 0;
6067 0 : for (;;) {
6068 0 : {
6069 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
6070 : #if !CYTHON_ASSUME_SAFE_MACROS
6071 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
6072 : #endif
6073 0 : if (__pyx_t_1 >= __pyx_temp) break;
6074 : }
6075 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6076 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
6077 : #else
6078 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
6079 : __Pyx_GOTREF(__pyx_t_5);
6080 : #endif
6081 0 : __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
6082 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6083 0 : __pyx_v_dim = __pyx_t_10;
6084 0 : __pyx_v_idx = __pyx_t_9;
6085 0 : __pyx_t_9 = (__pyx_t_9 + 1);
6086 :
6087 : /* "View.MemoryView":160
6088 : *
6089 : * for idx, dim in enumerate(shape):
6090 : * if dim <= 0: # <<<<<<<<<<<<<<
6091 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6092 : * self._shape[idx] = dim
6093 : */
6094 0 : __pyx_t_3 = (__pyx_v_dim <= 0);
6095 0 : if (unlikely(__pyx_t_3)) {
6096 :
6097 : /* "View.MemoryView":161
6098 : * for idx, dim in enumerate(shape):
6099 : * if dim <= 0:
6100 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
6101 : * self._shape[idx] = dim
6102 : *
6103 : */
6104 0 : __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
6105 0 : __Pyx_GOTREF(__pyx_t_5);
6106 0 : __pyx_t_10 = 0;
6107 0 : __pyx_t_11 = 127;
6108 0 : __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
6109 0 : __pyx_t_10 += 22;
6110 0 : __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
6111 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
6112 0 : __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
6113 0 : __Pyx_GOTREF(__pyx_t_6);
6114 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
6115 0 : __Pyx_GIVEREF(__pyx_t_6);
6116 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
6117 0 : __pyx_t_6 = 0;
6118 0 : __Pyx_INCREF(__pyx_kp_u_);
6119 0 : __pyx_t_10 += 2;
6120 0 : __Pyx_GIVEREF(__pyx_kp_u_);
6121 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_);
6122 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
6123 0 : __Pyx_GOTREF(__pyx_t_6);
6124 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
6125 0 : __Pyx_GIVEREF(__pyx_t_6);
6126 0 : PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
6127 0 : __pyx_t_6 = 0;
6128 0 : __Pyx_INCREF(__pyx_kp_u__2);
6129 0 : __pyx_t_10 += 1;
6130 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
6131 0 : PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2);
6132 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
6133 0 : __Pyx_GOTREF(__pyx_t_6);
6134 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6135 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
6136 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6137 0 : __PYX_ERR(1, 161, __pyx_L1_error)
6138 :
6139 : /* "View.MemoryView":160
6140 : *
6141 : * for idx, dim in enumerate(shape):
6142 : * if dim <= 0: # <<<<<<<<<<<<<<
6143 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6144 : * self._shape[idx] = dim
6145 : */
6146 : }
6147 :
6148 : /* "View.MemoryView":162
6149 : * if dim <= 0:
6150 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6151 : * self._shape[idx] = dim # <<<<<<<<<<<<<<
6152 : *
6153 : * cdef char order
6154 : */
6155 0 : (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
6156 :
6157 : /* "View.MemoryView":159
6158 : *
6159 : *
6160 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
6161 : * if dim <= 0:
6162 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
6163 : */
6164 0 : }
6165 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6166 :
6167 : /* "View.MemoryView":165
6168 : *
6169 : * cdef char order
6170 : * if mode == 'c': # <<<<<<<<<<<<<<
6171 : * order = b'C'
6172 : * self.mode = u'c'
6173 : */
6174 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 165, __pyx_L1_error)
6175 0 : if (__pyx_t_3) {
6176 :
6177 : /* "View.MemoryView":166
6178 : * cdef char order
6179 : * if mode == 'c':
6180 : * order = b'C' # <<<<<<<<<<<<<<
6181 : * self.mode = u'c'
6182 : * elif mode == 'fortran':
6183 : */
6184 0 : __pyx_v_order = 'C';
6185 :
6186 : /* "View.MemoryView":167
6187 : * if mode == 'c':
6188 : * order = b'C'
6189 : * self.mode = u'c' # <<<<<<<<<<<<<<
6190 : * elif mode == 'fortran':
6191 : * order = b'F'
6192 : */
6193 0 : __Pyx_INCREF(__pyx_n_u_c);
6194 0 : __Pyx_GIVEREF(__pyx_n_u_c);
6195 0 : __Pyx_GOTREF(__pyx_v_self->mode);
6196 0 : __Pyx_DECREF(__pyx_v_self->mode);
6197 0 : __pyx_v_self->mode = __pyx_n_u_c;
6198 :
6199 : /* "View.MemoryView":165
6200 : *
6201 : * cdef char order
6202 : * if mode == 'c': # <<<<<<<<<<<<<<
6203 : * order = b'C'
6204 : * self.mode = u'c'
6205 : */
6206 0 : goto __pyx_L11;
6207 : }
6208 :
6209 : /* "View.MemoryView":168
6210 : * order = b'C'
6211 : * self.mode = u'c'
6212 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
6213 : * order = b'F'
6214 : * self.mode = u'fortran'
6215 : */
6216 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 168, __pyx_L1_error)
6217 0 : if (likely(__pyx_t_3)) {
6218 :
6219 : /* "View.MemoryView":169
6220 : * self.mode = u'c'
6221 : * elif mode == 'fortran':
6222 : * order = b'F' # <<<<<<<<<<<<<<
6223 : * self.mode = u'fortran'
6224 : * else:
6225 : */
6226 0 : __pyx_v_order = 'F';
6227 :
6228 : /* "View.MemoryView":170
6229 : * elif mode == 'fortran':
6230 : * order = b'F'
6231 : * self.mode = u'fortran' # <<<<<<<<<<<<<<
6232 : * else:
6233 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
6234 : */
6235 0 : __Pyx_INCREF(__pyx_n_u_fortran);
6236 0 : __Pyx_GIVEREF(__pyx_n_u_fortran);
6237 0 : __Pyx_GOTREF(__pyx_v_self->mode);
6238 0 : __Pyx_DECREF(__pyx_v_self->mode);
6239 0 : __pyx_v_self->mode = __pyx_n_u_fortran;
6240 :
6241 : /* "View.MemoryView":168
6242 : * order = b'C'
6243 : * self.mode = u'c'
6244 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
6245 : * order = b'F'
6246 : * self.mode = u'fortran'
6247 : */
6248 0 : goto __pyx_L11;
6249 : }
6250 :
6251 : /* "View.MemoryView":172
6252 : * self.mode = u'fortran'
6253 : * else:
6254 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
6255 : *
6256 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
6257 : */
6258 0 : /*else*/ {
6259 0 : __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
6260 0 : __Pyx_GOTREF(__pyx_t_4);
6261 0 : __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
6262 0 : __Pyx_GOTREF(__pyx_t_6);
6263 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6264 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
6265 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6266 0 : __PYX_ERR(1, 172, __pyx_L1_error)
6267 : }
6268 0 : __pyx_L11:;
6269 :
6270 : /* "View.MemoryView":174
6271 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
6272 : *
6273 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
6274 : *
6275 : * self.free_data = allocate_buffer
6276 : */
6277 0 : __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
6278 :
6279 : /* "View.MemoryView":176
6280 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
6281 : *
6282 : * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
6283 : * self.dtype_is_object = format == b'O'
6284 : *
6285 : */
6286 0 : __pyx_v_self->free_data = __pyx_v_allocate_buffer;
6287 :
6288 : /* "View.MemoryView":177
6289 : *
6290 : * self.free_data = allocate_buffer
6291 : * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
6292 : *
6293 : * if allocate_buffer:
6294 : */
6295 0 : __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
6296 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
6297 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6298 0 : __pyx_v_self->dtype_is_object = __pyx_t_3;
6299 :
6300 : /* "View.MemoryView":179
6301 : * self.dtype_is_object = format == b'O'
6302 : *
6303 : * if allocate_buffer: # <<<<<<<<<<<<<<
6304 : * _allocate_buffer(self)
6305 : *
6306 : */
6307 0 : if (__pyx_v_allocate_buffer) {
6308 :
6309 : /* "View.MemoryView":180
6310 : *
6311 : * if allocate_buffer:
6312 : * _allocate_buffer(self) # <<<<<<<<<<<<<<
6313 : *
6314 : * @cname('getbuffer')
6315 : */
6316 0 : __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error)
6317 :
6318 : /* "View.MemoryView":179
6319 : * self.dtype_is_object = format == b'O'
6320 : *
6321 : * if allocate_buffer: # <<<<<<<<<<<<<<
6322 : * _allocate_buffer(self)
6323 : *
6324 : */
6325 : }
6326 :
6327 : /* "View.MemoryView":131
6328 : * cdef bint dtype_is_object
6329 : *
6330 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6331 : * mode="c", bint allocate_buffer=True):
6332 : *
6333 : */
6334 :
6335 : /* function exit code */
6336 0 : __pyx_r = 0;
6337 0 : goto __pyx_L0;
6338 0 : __pyx_L1_error:;
6339 0 : __Pyx_XDECREF(__pyx_t_4);
6340 0 : __Pyx_XDECREF(__pyx_t_5);
6341 0 : __Pyx_XDECREF(__pyx_t_6);
6342 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6343 0 : __pyx_r = -1;
6344 0 : __pyx_L0:;
6345 0 : __Pyx_XDECREF(__pyx_v_format);
6346 0 : __Pyx_RefNannyFinishContext();
6347 0 : return __pyx_r;
6348 : }
6349 :
6350 : /* "View.MemoryView":182
6351 : * _allocate_buffer(self)
6352 : *
6353 : * @cname('getbuffer') # <<<<<<<<<<<<<<
6354 : * def __getbuffer__(self, Py_buffer *info, int flags):
6355 : * cdef int bufmode = -1
6356 : */
6357 :
6358 : /* Python wrapper */
6359 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
6360 0 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6361 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6362 0 : int __pyx_r;
6363 : __Pyx_RefNannyDeclarations
6364 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
6365 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6366 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
6367 :
6368 : /* function exit code */
6369 0 : __Pyx_RefNannyFinishContext();
6370 0 : return __pyx_r;
6371 : }
6372 :
6373 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
6374 0 : int __pyx_v_bufmode;
6375 0 : int __pyx_r;
6376 : __Pyx_RefNannyDeclarations
6377 0 : int __pyx_t_1;
6378 0 : char *__pyx_t_2;
6379 0 : Py_ssize_t __pyx_t_3;
6380 0 : int __pyx_t_4;
6381 0 : Py_ssize_t *__pyx_t_5;
6382 0 : int __pyx_lineno = 0;
6383 0 : const char *__pyx_filename = NULL;
6384 0 : int __pyx_clineno = 0;
6385 0 : if (unlikely(__pyx_v_info == NULL)) {
6386 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
6387 0 : return -1;
6388 : }
6389 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
6390 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
6391 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
6392 :
6393 : /* "View.MemoryView":184
6394 : * @cname('getbuffer')
6395 : * def __getbuffer__(self, Py_buffer *info, int flags):
6396 : * cdef int bufmode = -1 # <<<<<<<<<<<<<<
6397 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6398 : * if self.mode == u"c":
6399 : */
6400 0 : __pyx_v_bufmode = -1;
6401 :
6402 : /* "View.MemoryView":185
6403 : * def __getbuffer__(self, Py_buffer *info, int flags):
6404 : * cdef int bufmode = -1
6405 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
6406 : * if self.mode == u"c":
6407 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6408 : */
6409 0 : __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
6410 0 : if (__pyx_t_1) {
6411 :
6412 : /* "View.MemoryView":186
6413 : * cdef int bufmode = -1
6414 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6415 : * if self.mode == u"c": # <<<<<<<<<<<<<<
6416 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6417 : * elif self.mode == u"fortran":
6418 : */
6419 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
6420 0 : if (__pyx_t_1) {
6421 :
6422 : /* "View.MemoryView":187
6423 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6424 : * if self.mode == u"c":
6425 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6426 : * elif self.mode == u"fortran":
6427 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6428 : */
6429 0 : __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6430 :
6431 : /* "View.MemoryView":186
6432 : * cdef int bufmode = -1
6433 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
6434 : * if self.mode == u"c": # <<<<<<<<<<<<<<
6435 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6436 : * elif self.mode == u"fortran":
6437 : */
6438 0 : goto __pyx_L4;
6439 : }
6440 :
6441 : /* "View.MemoryView":188
6442 : * if self.mode == u"c":
6443 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6444 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6445 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6446 : * if not (flags & bufmode):
6447 : */
6448 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 188, __pyx_L1_error)
6449 0 : if (__pyx_t_1) {
6450 :
6451 : /* "View.MemoryView":189
6452 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6453 : * elif self.mode == u"fortran":
6454 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
6455 : * if not (flags & bufmode):
6456 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6457 : */
6458 0 : __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
6459 :
6460 : /* "View.MemoryView":188
6461 : * if self.mode == u"c":
6462 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6463 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
6464 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6465 : * if not (flags & bufmode):
6466 : */
6467 : }
6468 0 : __pyx_L4:;
6469 :
6470 : /* "View.MemoryView":190
6471 : * elif self.mode == u"fortran":
6472 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6473 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
6474 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6475 : * info.buf = self.data
6476 : */
6477 0 : __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
6478 0 : if (unlikely(__pyx_t_1)) {
6479 :
6480 : /* "View.MemoryView":191
6481 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6482 : * if not (flags & bufmode):
6483 : * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
6484 : * info.buf = self.data
6485 : * info.len = self.len
6486 : */
6487 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
6488 0 : __PYX_ERR(1, 191, __pyx_L1_error)
6489 :
6490 : /* "View.MemoryView":190
6491 : * elif self.mode == u"fortran":
6492 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6493 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
6494 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6495 : * info.buf = self.data
6496 : */
6497 : }
6498 :
6499 : /* "View.MemoryView":185
6500 : * def __getbuffer__(self, Py_buffer *info, int flags):
6501 : * cdef int bufmode = -1
6502 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
6503 : * if self.mode == u"c":
6504 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
6505 : */
6506 : }
6507 :
6508 : /* "View.MemoryView":192
6509 : * if not (flags & bufmode):
6510 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6511 : * info.buf = self.data # <<<<<<<<<<<<<<
6512 : * info.len = self.len
6513 : *
6514 : */
6515 0 : __pyx_t_2 = __pyx_v_self->data;
6516 0 : __pyx_v_info->buf = __pyx_t_2;
6517 :
6518 : /* "View.MemoryView":193
6519 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
6520 : * info.buf = self.data
6521 : * info.len = self.len # <<<<<<<<<<<<<<
6522 : *
6523 : * if flags & PyBUF_STRIDES:
6524 : */
6525 0 : __pyx_t_3 = __pyx_v_self->len;
6526 0 : __pyx_v_info->len = __pyx_t_3;
6527 :
6528 : /* "View.MemoryView":195
6529 : * info.len = self.len
6530 : *
6531 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
6532 : * info.ndim = self.ndim
6533 : * info.shape = self._shape
6534 : */
6535 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
6536 0 : if (__pyx_t_1) {
6537 :
6538 : /* "View.MemoryView":196
6539 : *
6540 : * if flags & PyBUF_STRIDES:
6541 : * info.ndim = self.ndim # <<<<<<<<<<<<<<
6542 : * info.shape = self._shape
6543 : * info.strides = self._strides
6544 : */
6545 0 : __pyx_t_4 = __pyx_v_self->ndim;
6546 0 : __pyx_v_info->ndim = __pyx_t_4;
6547 :
6548 : /* "View.MemoryView":197
6549 : * if flags & PyBUF_STRIDES:
6550 : * info.ndim = self.ndim
6551 : * info.shape = self._shape # <<<<<<<<<<<<<<
6552 : * info.strides = self._strides
6553 : * else:
6554 : */
6555 0 : __pyx_t_5 = __pyx_v_self->_shape;
6556 0 : __pyx_v_info->shape = __pyx_t_5;
6557 :
6558 : /* "View.MemoryView":198
6559 : * info.ndim = self.ndim
6560 : * info.shape = self._shape
6561 : * info.strides = self._strides # <<<<<<<<<<<<<<
6562 : * else:
6563 : * info.ndim = 1
6564 : */
6565 0 : __pyx_t_5 = __pyx_v_self->_strides;
6566 0 : __pyx_v_info->strides = __pyx_t_5;
6567 :
6568 : /* "View.MemoryView":195
6569 : * info.len = self.len
6570 : *
6571 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
6572 : * info.ndim = self.ndim
6573 : * info.shape = self._shape
6574 : */
6575 0 : goto __pyx_L6;
6576 : }
6577 :
6578 : /* "View.MemoryView":200
6579 : * info.strides = self._strides
6580 : * else:
6581 : * info.ndim = 1 # <<<<<<<<<<<<<<
6582 : * info.shape = &self.len if flags & PyBUF_ND else NULL
6583 : * info.strides = NULL
6584 : */
6585 0 : /*else*/ {
6586 0 : __pyx_v_info->ndim = 1;
6587 :
6588 : /* "View.MemoryView":201
6589 : * else:
6590 : * info.ndim = 1
6591 : * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
6592 : * info.strides = NULL
6593 : *
6594 : */
6595 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
6596 0 : if (__pyx_t_1) {
6597 : __pyx_t_5 = (&__pyx_v_self->len);
6598 : } else {
6599 : __pyx_t_5 = NULL;
6600 : }
6601 0 : __pyx_v_info->shape = __pyx_t_5;
6602 :
6603 : /* "View.MemoryView":202
6604 : * info.ndim = 1
6605 : * info.shape = &self.len if flags & PyBUF_ND else NULL
6606 : * info.strides = NULL # <<<<<<<<<<<<<<
6607 : *
6608 : * info.suboffsets = NULL
6609 : */
6610 0 : __pyx_v_info->strides = NULL;
6611 : }
6612 0 : __pyx_L6:;
6613 :
6614 : /* "View.MemoryView":204
6615 : * info.strides = NULL
6616 : *
6617 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
6618 : * info.itemsize = self.itemsize
6619 : * info.readonly = 0
6620 : */
6621 0 : __pyx_v_info->suboffsets = NULL;
6622 :
6623 : /* "View.MemoryView":205
6624 : *
6625 : * info.suboffsets = NULL
6626 : * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
6627 : * info.readonly = 0
6628 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
6629 : */
6630 0 : __pyx_t_3 = __pyx_v_self->itemsize;
6631 0 : __pyx_v_info->itemsize = __pyx_t_3;
6632 :
6633 : /* "View.MemoryView":206
6634 : * info.suboffsets = NULL
6635 : * info.itemsize = self.itemsize
6636 : * info.readonly = 0 # <<<<<<<<<<<<<<
6637 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
6638 : * info.obj = self
6639 : */
6640 0 : __pyx_v_info->readonly = 0;
6641 :
6642 : /* "View.MemoryView":207
6643 : * info.itemsize = self.itemsize
6644 : * info.readonly = 0
6645 : * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
6646 : * info.obj = self
6647 : *
6648 : */
6649 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
6650 0 : if (__pyx_t_1) {
6651 0 : __pyx_t_2 = __pyx_v_self->format;
6652 : } else {
6653 : __pyx_t_2 = NULL;
6654 : }
6655 0 : __pyx_v_info->format = __pyx_t_2;
6656 :
6657 : /* "View.MemoryView":208
6658 : * info.readonly = 0
6659 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
6660 : * info.obj = self # <<<<<<<<<<<<<<
6661 : *
6662 : * def __dealloc__(array self):
6663 : */
6664 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
6665 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
6666 0 : __Pyx_GOTREF(__pyx_v_info->obj);
6667 0 : __Pyx_DECREF(__pyx_v_info->obj);
6668 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
6669 :
6670 : /* "View.MemoryView":182
6671 : * _allocate_buffer(self)
6672 : *
6673 : * @cname('getbuffer') # <<<<<<<<<<<<<<
6674 : * def __getbuffer__(self, Py_buffer *info, int flags):
6675 : * cdef int bufmode = -1
6676 : */
6677 :
6678 : /* function exit code */
6679 0 : __pyx_r = 0;
6680 0 : goto __pyx_L0;
6681 0 : __pyx_L1_error:;
6682 0 : __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6683 0 : __pyx_r = -1;
6684 0 : if (__pyx_v_info->obj != NULL) {
6685 0 : __Pyx_GOTREF(__pyx_v_info->obj);
6686 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6687 : }
6688 0 : goto __pyx_L2;
6689 0 : __pyx_L0:;
6690 0 : if (__pyx_v_info->obj == Py_None) {
6691 0 : __Pyx_GOTREF(__pyx_v_info->obj);
6692 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6693 : }
6694 0 : __pyx_L2:;
6695 : __Pyx_RefNannyFinishContext();
6696 : return __pyx_r;
6697 : }
6698 :
6699 : /* "View.MemoryView":210
6700 : * info.obj = self
6701 : *
6702 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
6703 : * if self.callback_free_data != NULL:
6704 : * self.callback_free_data(self.data)
6705 : */
6706 :
6707 : /* Python wrapper */
6708 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
6709 0 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
6710 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6711 : __Pyx_RefNannyDeclarations
6712 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
6713 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6714 0 : __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
6715 :
6716 : /* function exit code */
6717 0 : __Pyx_RefNannyFinishContext();
6718 : }
6719 :
6720 0 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
6721 0 : int __pyx_t_1;
6722 0 : int __pyx_t_2;
6723 :
6724 : /* "View.MemoryView":211
6725 : *
6726 : * def __dealloc__(array self):
6727 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6728 : * self.callback_free_data(self.data)
6729 : * elif self.free_data and self.data is not NULL:
6730 : */
6731 0 : __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
6732 0 : if (__pyx_t_1) {
6733 :
6734 : /* "View.MemoryView":212
6735 : * def __dealloc__(array self):
6736 : * if self.callback_free_data != NULL:
6737 : * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
6738 : * elif self.free_data and self.data is not NULL:
6739 : * if self.dtype_is_object:
6740 : */
6741 0 : __pyx_v_self->callback_free_data(__pyx_v_self->data);
6742 :
6743 : /* "View.MemoryView":211
6744 : *
6745 : * def __dealloc__(array self):
6746 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
6747 : * self.callback_free_data(self.data)
6748 : * elif self.free_data and self.data is not NULL:
6749 : */
6750 0 : goto __pyx_L3;
6751 : }
6752 :
6753 : /* "View.MemoryView":213
6754 : * if self.callback_free_data != NULL:
6755 : * self.callback_free_data(self.data)
6756 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6757 : * if self.dtype_is_object:
6758 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6759 : */
6760 0 : if (__pyx_v_self->free_data) {
6761 : } else {
6762 0 : __pyx_t_1 = __pyx_v_self->free_data;
6763 0 : goto __pyx_L4_bool_binop_done;
6764 : }
6765 0 : __pyx_t_2 = (__pyx_v_self->data != NULL);
6766 0 : __pyx_t_1 = __pyx_t_2;
6767 0 : __pyx_L4_bool_binop_done:;
6768 0 : if (__pyx_t_1) {
6769 :
6770 : /* "View.MemoryView":214
6771 : * self.callback_free_data(self.data)
6772 : * elif self.free_data and self.data is not NULL:
6773 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6774 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6775 : * free(self.data)
6776 : */
6777 0 : if (__pyx_v_self->dtype_is_object) {
6778 :
6779 : /* "View.MemoryView":215
6780 : * elif self.free_data and self.data is not NULL:
6781 : * if self.dtype_is_object:
6782 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
6783 : * free(self.data)
6784 : * PyObject_Free(self._shape)
6785 : */
6786 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
6787 :
6788 : /* "View.MemoryView":214
6789 : * self.callback_free_data(self.data)
6790 : * elif self.free_data and self.data is not NULL:
6791 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6792 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6793 : * free(self.data)
6794 : */
6795 : }
6796 :
6797 : /* "View.MemoryView":216
6798 : * if self.dtype_is_object:
6799 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6800 : * free(self.data) # <<<<<<<<<<<<<<
6801 : * PyObject_Free(self._shape)
6802 : *
6803 : */
6804 0 : free(__pyx_v_self->data);
6805 :
6806 : /* "View.MemoryView":213
6807 : * if self.callback_free_data != NULL:
6808 : * self.callback_free_data(self.data)
6809 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
6810 : * if self.dtype_is_object:
6811 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6812 : */
6813 : }
6814 0 : __pyx_L3:;
6815 :
6816 : /* "View.MemoryView":217
6817 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
6818 : * free(self.data)
6819 : * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
6820 : *
6821 : * @property
6822 : */
6823 0 : PyObject_Free(__pyx_v_self->_shape);
6824 :
6825 : /* "View.MemoryView":210
6826 : * info.obj = self
6827 : *
6828 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
6829 : * if self.callback_free_data != NULL:
6830 : * self.callback_free_data(self.data)
6831 : */
6832 :
6833 : /* function exit code */
6834 0 : }
6835 :
6836 : /* "View.MemoryView":219
6837 : * PyObject_Free(self._shape)
6838 : *
6839 : * @property # <<<<<<<<<<<<<<
6840 : * def memview(self):
6841 : * return self.get_memview()
6842 : */
6843 :
6844 : /* Python wrapper */
6845 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
6846 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
6847 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6848 0 : PyObject *__pyx_r = 0;
6849 : __Pyx_RefNannyDeclarations
6850 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
6851 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6852 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
6853 :
6854 : /* function exit code */
6855 0 : __Pyx_RefNannyFinishContext();
6856 0 : return __pyx_r;
6857 : }
6858 :
6859 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
6860 0 : PyObject *__pyx_r = NULL;
6861 : __Pyx_RefNannyDeclarations
6862 0 : PyObject *__pyx_t_1 = NULL;
6863 0 : int __pyx_lineno = 0;
6864 0 : const char *__pyx_filename = NULL;
6865 0 : int __pyx_clineno = 0;
6866 0 : __Pyx_RefNannySetupContext("__get__", 1);
6867 :
6868 : /* "View.MemoryView":221
6869 : * @property
6870 : * def memview(self):
6871 : * return self.get_memview() # <<<<<<<<<<<<<<
6872 : *
6873 : * @cname('get_memview')
6874 : */
6875 0 : __Pyx_XDECREF(__pyx_r);
6876 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
6877 0 : __Pyx_GOTREF(__pyx_t_1);
6878 0 : __pyx_r = __pyx_t_1;
6879 0 : __pyx_t_1 = 0;
6880 0 : goto __pyx_L0;
6881 :
6882 : /* "View.MemoryView":219
6883 : * PyObject_Free(self._shape)
6884 : *
6885 : * @property # <<<<<<<<<<<<<<
6886 : * def memview(self):
6887 : * return self.get_memview()
6888 : */
6889 :
6890 : /* function exit code */
6891 0 : __pyx_L1_error:;
6892 0 : __Pyx_XDECREF(__pyx_t_1);
6893 0 : __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6894 0 : __pyx_r = NULL;
6895 0 : __pyx_L0:;
6896 0 : __Pyx_XGIVEREF(__pyx_r);
6897 0 : __Pyx_RefNannyFinishContext();
6898 0 : return __pyx_r;
6899 : }
6900 :
6901 : /* "View.MemoryView":224
6902 : *
6903 : * @cname('get_memview')
6904 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6905 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6906 : * return memoryview(self, flags, self.dtype_is_object)
6907 : */
6908 :
6909 0 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
6910 0 : int __pyx_v_flags;
6911 0 : PyObject *__pyx_r = NULL;
6912 : __Pyx_RefNannyDeclarations
6913 0 : PyObject *__pyx_t_1 = NULL;
6914 0 : PyObject *__pyx_t_2 = NULL;
6915 0 : PyObject *__pyx_t_3 = NULL;
6916 0 : int __pyx_lineno = 0;
6917 0 : const char *__pyx_filename = NULL;
6918 0 : int __pyx_clineno = 0;
6919 0 : __Pyx_RefNannySetupContext("get_memview", 1);
6920 :
6921 : /* "View.MemoryView":225
6922 : * @cname('get_memview')
6923 : * cdef get_memview(self):
6924 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
6925 : * return memoryview(self, flags, self.dtype_is_object)
6926 : *
6927 : */
6928 0 : __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
6929 :
6930 : /* "View.MemoryView":226
6931 : * cdef get_memview(self):
6932 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6933 : * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
6934 : *
6935 : * def __len__(self):
6936 : */
6937 0 : __Pyx_XDECREF(__pyx_r);
6938 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
6939 0 : __Pyx_GOTREF(__pyx_t_1);
6940 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6941 0 : __Pyx_GOTREF(__pyx_t_2);
6942 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error)
6943 0 : __Pyx_GOTREF(__pyx_t_3);
6944 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
6945 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
6946 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(1, 226, __pyx_L1_error);
6947 0 : __Pyx_GIVEREF(__pyx_t_1);
6948 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error);
6949 0 : __Pyx_GIVEREF(__pyx_t_2);
6950 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error);
6951 0 : __pyx_t_1 = 0;
6952 0 : __pyx_t_2 = 0;
6953 0 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6954 0 : __Pyx_GOTREF(__pyx_t_2);
6955 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6956 0 : __pyx_r = __pyx_t_2;
6957 0 : __pyx_t_2 = 0;
6958 0 : goto __pyx_L0;
6959 :
6960 : /* "View.MemoryView":224
6961 : *
6962 : * @cname('get_memview')
6963 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6964 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6965 : * return memoryview(self, flags, self.dtype_is_object)
6966 : */
6967 :
6968 : /* function exit code */
6969 0 : __pyx_L1_error:;
6970 0 : __Pyx_XDECREF(__pyx_t_1);
6971 0 : __Pyx_XDECREF(__pyx_t_2);
6972 0 : __Pyx_XDECREF(__pyx_t_3);
6973 0 : __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
6974 0 : __pyx_r = 0;
6975 0 : __pyx_L0:;
6976 0 : __Pyx_XGIVEREF(__pyx_r);
6977 0 : __Pyx_RefNannyFinishContext();
6978 0 : return __pyx_r;
6979 : }
6980 :
6981 : /* "View.MemoryView":228
6982 : * return memoryview(self, flags, self.dtype_is_object)
6983 : *
6984 : * def __len__(self): # <<<<<<<<<<<<<<
6985 : * return self._shape[0]
6986 : *
6987 : */
6988 :
6989 : /* Python wrapper */
6990 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6991 0 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6992 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6993 0 : Py_ssize_t __pyx_r;
6994 : __Pyx_RefNannyDeclarations
6995 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6996 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6997 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6998 :
6999 : /* function exit code */
7000 0 : __Pyx_RefNannyFinishContext();
7001 0 : return __pyx_r;
7002 : }
7003 :
7004 0 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
7005 0 : Py_ssize_t __pyx_r;
7006 :
7007 : /* "View.MemoryView":229
7008 : *
7009 : * def __len__(self):
7010 : * return self._shape[0] # <<<<<<<<<<<<<<
7011 : *
7012 : * def __getattr__(self, attr):
7013 : */
7014 0 : __pyx_r = (__pyx_v_self->_shape[0]);
7015 0 : goto __pyx_L0;
7016 :
7017 : /* "View.MemoryView":228
7018 : * return memoryview(self, flags, self.dtype_is_object)
7019 : *
7020 : * def __len__(self): # <<<<<<<<<<<<<<
7021 : * return self._shape[0]
7022 : *
7023 : */
7024 :
7025 : /* function exit code */
7026 0 : __pyx_L0:;
7027 0 : return __pyx_r;
7028 : }
7029 :
7030 : /* "View.MemoryView":231
7031 : * return self._shape[0]
7032 : *
7033 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7034 : * return getattr(self.memview, attr)
7035 : *
7036 : */
7037 :
7038 : /* Python wrapper */
7039 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
7040 0 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
7041 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7042 0 : PyObject *__pyx_r = 0;
7043 : __Pyx_RefNannyDeclarations
7044 0 : __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
7045 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7046 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
7047 :
7048 : /* function exit code */
7049 0 : __Pyx_RefNannyFinishContext();
7050 0 : return __pyx_r;
7051 : }
7052 :
7053 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
7054 0 : PyObject *__pyx_r = NULL;
7055 : __Pyx_RefNannyDeclarations
7056 0 : PyObject *__pyx_t_1 = NULL;
7057 0 : PyObject *__pyx_t_2 = NULL;
7058 0 : int __pyx_lineno = 0;
7059 0 : const char *__pyx_filename = NULL;
7060 0 : int __pyx_clineno = 0;
7061 0 : __Pyx_RefNannySetupContext("__getattr__", 1);
7062 :
7063 : /* "View.MemoryView":232
7064 : *
7065 : * def __getattr__(self, attr):
7066 : * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
7067 : *
7068 : * def __getitem__(self, item):
7069 : */
7070 0 : __Pyx_XDECREF(__pyx_r);
7071 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
7072 0 : __Pyx_GOTREF(__pyx_t_1);
7073 0 : __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
7074 0 : __Pyx_GOTREF(__pyx_t_2);
7075 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7076 0 : __pyx_r = __pyx_t_2;
7077 0 : __pyx_t_2 = 0;
7078 0 : goto __pyx_L0;
7079 :
7080 : /* "View.MemoryView":231
7081 : * return self._shape[0]
7082 : *
7083 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
7084 : * return getattr(self.memview, attr)
7085 : *
7086 : */
7087 :
7088 : /* function exit code */
7089 0 : __pyx_L1_error:;
7090 0 : __Pyx_XDECREF(__pyx_t_1);
7091 0 : __Pyx_XDECREF(__pyx_t_2);
7092 0 : __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7093 0 : __pyx_r = NULL;
7094 0 : __pyx_L0:;
7095 0 : __Pyx_XGIVEREF(__pyx_r);
7096 0 : __Pyx_RefNannyFinishContext();
7097 0 : return __pyx_r;
7098 : }
7099 :
7100 : /* "View.MemoryView":234
7101 : * return getattr(self.memview, attr)
7102 : *
7103 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
7104 : * return self.memview[item]
7105 : *
7106 : */
7107 :
7108 : /* Python wrapper */
7109 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
7110 0 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
7111 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7112 0 : PyObject *__pyx_r = 0;
7113 : __Pyx_RefNannyDeclarations
7114 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
7115 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7116 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
7117 :
7118 : /* function exit code */
7119 0 : __Pyx_RefNannyFinishContext();
7120 0 : return __pyx_r;
7121 : }
7122 :
7123 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
7124 0 : PyObject *__pyx_r = NULL;
7125 : __Pyx_RefNannyDeclarations
7126 0 : PyObject *__pyx_t_1 = NULL;
7127 0 : PyObject *__pyx_t_2 = NULL;
7128 0 : int __pyx_lineno = 0;
7129 0 : const char *__pyx_filename = NULL;
7130 0 : int __pyx_clineno = 0;
7131 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
7132 :
7133 : /* "View.MemoryView":235
7134 : *
7135 : * def __getitem__(self, item):
7136 : * return self.memview[item] # <<<<<<<<<<<<<<
7137 : *
7138 : * def __setitem__(self, item, value):
7139 : */
7140 0 : __Pyx_XDECREF(__pyx_r);
7141 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
7142 0 : __Pyx_GOTREF(__pyx_t_1);
7143 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
7144 0 : __Pyx_GOTREF(__pyx_t_2);
7145 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7146 0 : __pyx_r = __pyx_t_2;
7147 0 : __pyx_t_2 = 0;
7148 0 : goto __pyx_L0;
7149 :
7150 : /* "View.MemoryView":234
7151 : * return getattr(self.memview, attr)
7152 : *
7153 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
7154 : * return self.memview[item]
7155 : *
7156 : */
7157 :
7158 : /* function exit code */
7159 0 : __pyx_L1_error:;
7160 0 : __Pyx_XDECREF(__pyx_t_1);
7161 0 : __Pyx_XDECREF(__pyx_t_2);
7162 0 : __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7163 0 : __pyx_r = NULL;
7164 0 : __pyx_L0:;
7165 0 : __Pyx_XGIVEREF(__pyx_r);
7166 0 : __Pyx_RefNannyFinishContext();
7167 0 : return __pyx_r;
7168 : }
7169 :
7170 : /* "View.MemoryView":237
7171 : * return self.memview[item]
7172 : *
7173 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7174 : * self.memview[item] = value
7175 : *
7176 : */
7177 :
7178 : /* Python wrapper */
7179 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
7180 0 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7181 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7182 0 : int __pyx_r;
7183 : __Pyx_RefNannyDeclarations
7184 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
7185 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7186 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
7187 :
7188 : /* function exit code */
7189 0 : __Pyx_RefNannyFinishContext();
7190 0 : return __pyx_r;
7191 : }
7192 :
7193 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
7194 0 : int __pyx_r;
7195 : __Pyx_RefNannyDeclarations
7196 0 : PyObject *__pyx_t_1 = NULL;
7197 0 : int __pyx_lineno = 0;
7198 0 : const char *__pyx_filename = NULL;
7199 0 : int __pyx_clineno = 0;
7200 0 : __Pyx_RefNannySetupContext("__setitem__", 1);
7201 :
7202 : /* "View.MemoryView":238
7203 : *
7204 : * def __setitem__(self, item, value):
7205 : * self.memview[item] = value # <<<<<<<<<<<<<<
7206 : *
7207 : *
7208 : */
7209 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
7210 0 : __Pyx_GOTREF(__pyx_t_1);
7211 0 : if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 238, __pyx_L1_error)
7212 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7213 :
7214 : /* "View.MemoryView":237
7215 : * return self.memview[item]
7216 : *
7217 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
7218 : * self.memview[item] = value
7219 : *
7220 : */
7221 :
7222 : /* function exit code */
7223 0 : __pyx_r = 0;
7224 0 : goto __pyx_L0;
7225 0 : __pyx_L1_error:;
7226 0 : __Pyx_XDECREF(__pyx_t_1);
7227 0 : __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7228 0 : __pyx_r = -1;
7229 0 : __pyx_L0:;
7230 0 : __Pyx_RefNannyFinishContext();
7231 0 : return __pyx_r;
7232 : }
7233 :
7234 : /* "(tree fragment)":1
7235 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7236 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7237 : * def __setstate_cython__(self, __pyx_state):
7238 : */
7239 :
7240 : /* Python wrapper */
7241 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
7242 : #if CYTHON_METH_FASTCALL
7243 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7244 : #else
7245 : PyObject *__pyx_args, PyObject *__pyx_kwds
7246 : #endif
7247 : ); /*proto*/
7248 0 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
7249 : #if CYTHON_METH_FASTCALL
7250 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7251 : #else
7252 : PyObject *__pyx_args, PyObject *__pyx_kwds
7253 : #endif
7254 : ) {
7255 : #if !CYTHON_METH_FASTCALL
7256 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7257 : #endif
7258 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7259 0 : PyObject *__pyx_r = 0;
7260 : __Pyx_RefNannyDeclarations
7261 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7262 : #if !CYTHON_METH_FASTCALL
7263 : #if CYTHON_ASSUME_SAFE_MACROS
7264 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7265 : #else
7266 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7267 : #endif
7268 : #endif
7269 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7270 0 : if (unlikely(__pyx_nargs > 0)) {
7271 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7272 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7273 0 : __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
7274 :
7275 : /* function exit code */
7276 0 : __Pyx_RefNannyFinishContext();
7277 0 : return __pyx_r;
7278 : }
7279 :
7280 0 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
7281 0 : PyObject *__pyx_r = NULL;
7282 : __Pyx_RefNannyDeclarations
7283 0 : int __pyx_lineno = 0;
7284 0 : const char *__pyx_filename = NULL;
7285 0 : int __pyx_clineno = 0;
7286 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
7287 :
7288 : /* "(tree fragment)":2
7289 : * def __reduce_cython__(self):
7290 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
7291 : * def __setstate_cython__(self, __pyx_state):
7292 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7293 : */
7294 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
7295 0 : __PYX_ERR(1, 2, __pyx_L1_error)
7296 :
7297 : /* "(tree fragment)":1
7298 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7299 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7300 : * def __setstate_cython__(self, __pyx_state):
7301 : */
7302 :
7303 : /* function exit code */
7304 0 : __pyx_L1_error:;
7305 0 : __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7306 0 : __pyx_r = NULL;
7307 0 : __Pyx_XGIVEREF(__pyx_r);
7308 0 : __Pyx_RefNannyFinishContext();
7309 0 : return __pyx_r;
7310 : }
7311 :
7312 : /* "(tree fragment)":3
7313 : * def __reduce_cython__(self):
7314 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7315 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7316 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7317 : */
7318 :
7319 : /* Python wrapper */
7320 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
7321 : #if CYTHON_METH_FASTCALL
7322 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7323 : #else
7324 : PyObject *__pyx_args, PyObject *__pyx_kwds
7325 : #endif
7326 : ); /*proto*/
7327 0 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
7328 : #if CYTHON_METH_FASTCALL
7329 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7330 : #else
7331 : PyObject *__pyx_args, PyObject *__pyx_kwds
7332 : #endif
7333 : ) {
7334 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
7335 : #if !CYTHON_METH_FASTCALL
7336 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7337 : #endif
7338 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7339 0 : PyObject* values[1] = {0};
7340 0 : int __pyx_lineno = 0;
7341 0 : const char *__pyx_filename = NULL;
7342 0 : int __pyx_clineno = 0;
7343 0 : PyObject *__pyx_r = 0;
7344 : __Pyx_RefNannyDeclarations
7345 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7346 : #if !CYTHON_METH_FASTCALL
7347 : #if CYTHON_ASSUME_SAFE_MACROS
7348 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7349 : #else
7350 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7351 : #endif
7352 : #endif
7353 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7354 0 : {
7355 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
7356 0 : if (__pyx_kwds) {
7357 0 : Py_ssize_t kw_args;
7358 0 : switch (__pyx_nargs) {
7359 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7360 0 : CYTHON_FALLTHROUGH;
7361 0 : case 0: break;
7362 0 : default: goto __pyx_L5_argtuple_error;
7363 : }
7364 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
7365 0 : switch (__pyx_nargs) {
7366 0 : case 0:
7367 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
7368 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
7369 0 : kw_args--;
7370 : }
7371 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
7372 0 : else goto __pyx_L5_argtuple_error;
7373 : }
7374 0 : if (unlikely(kw_args > 0)) {
7375 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7376 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
7377 : }
7378 0 : } else if (unlikely(__pyx_nargs != 1)) {
7379 0 : goto __pyx_L5_argtuple_error;
7380 : } else {
7381 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7382 : }
7383 0 : __pyx_v___pyx_state = values[0];
7384 : }
7385 0 : goto __pyx_L6_skip;
7386 0 : __pyx_L5_argtuple_error:;
7387 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
7388 0 : __pyx_L6_skip:;
7389 0 : goto __pyx_L4_argument_unpacking_done;
7390 0 : __pyx_L3_error:;
7391 0 : {
7392 0 : Py_ssize_t __pyx_temp;
7393 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7394 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7395 : }
7396 : }
7397 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7398 : __Pyx_RefNannyFinishContext();
7399 : return NULL;
7400 0 : __pyx_L4_argument_unpacking_done:;
7401 0 : __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
7402 :
7403 : /* function exit code */
7404 : {
7405 : Py_ssize_t __pyx_temp;
7406 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7407 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7408 : }
7409 : }
7410 : __Pyx_RefNannyFinishContext();
7411 : return __pyx_r;
7412 : }
7413 :
7414 0 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
7415 0 : PyObject *__pyx_r = NULL;
7416 : __Pyx_RefNannyDeclarations
7417 0 : int __pyx_lineno = 0;
7418 0 : const char *__pyx_filename = NULL;
7419 0 : int __pyx_clineno = 0;
7420 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
7421 :
7422 : /* "(tree fragment)":4
7423 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7424 : * def __setstate_cython__(self, __pyx_state):
7425 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
7426 : */
7427 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
7428 0 : __PYX_ERR(1, 4, __pyx_L1_error)
7429 :
7430 : /* "(tree fragment)":3
7431 : * def __reduce_cython__(self):
7432 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7433 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7434 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
7435 : */
7436 :
7437 : /* function exit code */
7438 0 : __pyx_L1_error:;
7439 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7440 0 : __pyx_r = NULL;
7441 0 : __Pyx_XGIVEREF(__pyx_r);
7442 0 : __Pyx_RefNannyFinishContext();
7443 0 : return __pyx_r;
7444 : }
7445 :
7446 : /* "View.MemoryView":248
7447 : *
7448 : * @cname("__pyx_array_allocate_buffer")
7449 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
7450 : *
7451 : *
7452 : */
7453 :
7454 0 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
7455 0 : Py_ssize_t __pyx_v_i;
7456 0 : PyObject **__pyx_v_p;
7457 0 : int __pyx_r;
7458 0 : int __pyx_t_1;
7459 0 : Py_ssize_t __pyx_t_2;
7460 0 : Py_ssize_t __pyx_t_3;
7461 0 : Py_ssize_t __pyx_t_4;
7462 0 : int __pyx_lineno = 0;
7463 0 : const char *__pyx_filename = NULL;
7464 0 : int __pyx_clineno = 0;
7465 :
7466 : /* "View.MemoryView":254
7467 : * cdef PyObject **p
7468 : *
7469 : * self.free_data = True # <<<<<<<<<<<<<<
7470 : * self.data = <char *>malloc(self.len)
7471 : * if not self.data:
7472 : */
7473 0 : __pyx_v_self->free_data = 1;
7474 :
7475 : /* "View.MemoryView":255
7476 : *
7477 : * self.free_data = True
7478 : * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
7479 : * if not self.data:
7480 : * raise MemoryError, "unable to allocate array data."
7481 : */
7482 0 : __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
7483 :
7484 : /* "View.MemoryView":256
7485 : * self.free_data = True
7486 : * self.data = <char *>malloc(self.len)
7487 : * if not self.data: # <<<<<<<<<<<<<<
7488 : * raise MemoryError, "unable to allocate array data."
7489 : *
7490 : */
7491 0 : __pyx_t_1 = (!(__pyx_v_self->data != 0));
7492 0 : if (unlikely(__pyx_t_1)) {
7493 :
7494 : /* "View.MemoryView":257
7495 : * self.data = <char *>malloc(self.len)
7496 : * if not self.data:
7497 : * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
7498 : *
7499 : * if self.dtype_is_object:
7500 : */
7501 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
7502 0 : __PYX_ERR(1, 257, __pyx_L1_error)
7503 :
7504 : /* "View.MemoryView":256
7505 : * self.free_data = True
7506 : * self.data = <char *>malloc(self.len)
7507 : * if not self.data: # <<<<<<<<<<<<<<
7508 : * raise MemoryError, "unable to allocate array data."
7509 : *
7510 : */
7511 : }
7512 :
7513 : /* "View.MemoryView":259
7514 : * raise MemoryError, "unable to allocate array data."
7515 : *
7516 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
7517 : * p = <PyObject **> self.data
7518 : * for i in range(self.len // self.itemsize):
7519 : */
7520 0 : if (__pyx_v_self->dtype_is_object) {
7521 :
7522 : /* "View.MemoryView":260
7523 : *
7524 : * if self.dtype_is_object:
7525 : * p = <PyObject **> self.data # <<<<<<<<<<<<<<
7526 : * for i in range(self.len // self.itemsize):
7527 : * p[i] = Py_None
7528 : */
7529 0 : __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7530 :
7531 : /* "View.MemoryView":261
7532 : * if self.dtype_is_object:
7533 : * p = <PyObject **> self.data
7534 : * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
7535 : * p[i] = Py_None
7536 : * Py_INCREF(Py_None)
7537 : */
7538 0 : if (unlikely(__pyx_v_self->itemsize == 0)) {
7539 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7540 0 : __PYX_ERR(1, 261, __pyx_L1_error)
7541 : }
7542 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7543 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
7544 0 : __PYX_ERR(1, 261, __pyx_L1_error)
7545 : }
7546 0 : __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
7547 0 : __pyx_t_3 = __pyx_t_2;
7548 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7549 0 : __pyx_v_i = __pyx_t_4;
7550 :
7551 : /* "View.MemoryView":262
7552 : * p = <PyObject **> self.data
7553 : * for i in range(self.len // self.itemsize):
7554 : * p[i] = Py_None # <<<<<<<<<<<<<<
7555 : * Py_INCREF(Py_None)
7556 : * return 0
7557 : */
7558 0 : (__pyx_v_p[__pyx_v_i]) = Py_None;
7559 :
7560 : /* "View.MemoryView":263
7561 : * for i in range(self.len // self.itemsize):
7562 : * p[i] = Py_None
7563 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7564 : * return 0
7565 : *
7566 : */
7567 0 : Py_INCREF(Py_None);
7568 : }
7569 :
7570 : /* "View.MemoryView":259
7571 : * raise MemoryError, "unable to allocate array data."
7572 : *
7573 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
7574 : * p = <PyObject **> self.data
7575 : * for i in range(self.len // self.itemsize):
7576 : */
7577 : }
7578 :
7579 : /* "View.MemoryView":264
7580 : * p[i] = Py_None
7581 : * Py_INCREF(Py_None)
7582 : * return 0 # <<<<<<<<<<<<<<
7583 : *
7584 : *
7585 : */
7586 0 : __pyx_r = 0;
7587 0 : goto __pyx_L0;
7588 :
7589 : /* "View.MemoryView":248
7590 : *
7591 : * @cname("__pyx_array_allocate_buffer")
7592 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
7593 : *
7594 : *
7595 : */
7596 :
7597 : /* function exit code */
7598 0 : __pyx_L1_error:;
7599 0 : __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
7600 0 : __pyx_r = -1;
7601 0 : __pyx_L0:;
7602 0 : return __pyx_r;
7603 : }
7604 :
7605 : /* "View.MemoryView":268
7606 : *
7607 : * @cname("__pyx_array_new")
7608 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
7609 : * cdef array result
7610 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7611 : */
7612 :
7613 0 : static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
7614 0 : struct __pyx_array_obj *__pyx_v_result = 0;
7615 0 : PyObject *__pyx_v_mode = 0;
7616 0 : struct __pyx_array_obj *__pyx_r = NULL;
7617 : __Pyx_RefNannyDeclarations
7618 0 : PyObject *__pyx_t_1 = NULL;
7619 0 : int __pyx_t_2;
7620 0 : PyObject *__pyx_t_3 = NULL;
7621 0 : PyObject *__pyx_t_4 = NULL;
7622 0 : int __pyx_lineno = 0;
7623 0 : const char *__pyx_filename = NULL;
7624 0 : int __pyx_clineno = 0;
7625 0 : __Pyx_RefNannySetupContext("array_cwrapper", 1);
7626 :
7627 : /* "View.MemoryView":270
7628 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
7629 : * cdef array result
7630 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
7631 : *
7632 : * if buf is NULL:
7633 : */
7634 0 : __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
7635 0 : if (__pyx_t_2) {
7636 0 : __Pyx_INCREF(__pyx_n_s_fortran);
7637 : __pyx_t_1 = __pyx_n_s_fortran;
7638 : } else {
7639 0 : __Pyx_INCREF(__pyx_n_s_c);
7640 : __pyx_t_1 = __pyx_n_s_c;
7641 : }
7642 0 : __pyx_v_mode = ((PyObject*)__pyx_t_1);
7643 0 : __pyx_t_1 = 0;
7644 :
7645 : /* "View.MemoryView":272
7646 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7647 : *
7648 : * if buf is NULL: # <<<<<<<<<<<<<<
7649 : * result = array.__new__(array, shape, itemsize, format, mode)
7650 : * else:
7651 : */
7652 0 : __pyx_t_2 = (__pyx_v_buf == NULL);
7653 0 : if (__pyx_t_2) {
7654 :
7655 : /* "View.MemoryView":273
7656 : *
7657 : * if buf is NULL:
7658 : * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
7659 : * else:
7660 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
7661 : */
7662 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
7663 0 : __Pyx_GOTREF(__pyx_t_1);
7664 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
7665 0 : __Pyx_GOTREF(__pyx_t_3);
7666 0 : __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
7667 0 : __Pyx_GOTREF(__pyx_t_4);
7668 0 : __Pyx_INCREF(__pyx_v_shape);
7669 0 : __Pyx_GIVEREF(__pyx_v_shape);
7670 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(1, 273, __pyx_L1_error);
7671 0 : __Pyx_GIVEREF(__pyx_t_1);
7672 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error);
7673 0 : __Pyx_GIVEREF(__pyx_t_3);
7674 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error);
7675 0 : __Pyx_INCREF(__pyx_v_mode);
7676 0 : __Pyx_GIVEREF(__pyx_v_mode);
7677 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(1, 273, __pyx_L1_error);
7678 0 : __pyx_t_1 = 0;
7679 0 : __pyx_t_3 = 0;
7680 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
7681 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
7682 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7683 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
7684 0 : __pyx_t_3 = 0;
7685 :
7686 : /* "View.MemoryView":272
7687 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7688 : *
7689 : * if buf is NULL: # <<<<<<<<<<<<<<
7690 : * result = array.__new__(array, shape, itemsize, format, mode)
7691 : * else:
7692 : */
7693 0 : goto __pyx_L3;
7694 : }
7695 :
7696 : /* "View.MemoryView":275
7697 : * result = array.__new__(array, shape, itemsize, format, mode)
7698 : * else:
7699 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
7700 : * result.data = buf
7701 : *
7702 : */
7703 0 : /*else*/ {
7704 0 : __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
7705 0 : __Pyx_GOTREF(__pyx_t_3);
7706 0 : __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
7707 0 : __Pyx_GOTREF(__pyx_t_4);
7708 0 : __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
7709 0 : __Pyx_GOTREF(__pyx_t_1);
7710 0 : __Pyx_INCREF(__pyx_v_shape);
7711 0 : __Pyx_GIVEREF(__pyx_v_shape);
7712 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(1, 275, __pyx_L1_error);
7713 0 : __Pyx_GIVEREF(__pyx_t_3);
7714 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error);
7715 0 : __Pyx_GIVEREF(__pyx_t_4);
7716 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error);
7717 0 : __Pyx_INCREF(__pyx_v_mode);
7718 0 : __Pyx_GIVEREF(__pyx_v_mode);
7719 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(1, 275, __pyx_L1_error);
7720 0 : __pyx_t_3 = 0;
7721 0 : __pyx_t_4 = 0;
7722 0 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
7723 0 : __Pyx_GOTREF(__pyx_t_4);
7724 0 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
7725 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
7726 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
7727 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7728 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7729 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
7730 0 : __pyx_t_3 = 0;
7731 :
7732 : /* "View.MemoryView":276
7733 : * else:
7734 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
7735 : * result.data = buf # <<<<<<<<<<<<<<
7736 : *
7737 : * return result
7738 : */
7739 0 : __pyx_v_result->data = __pyx_v_buf;
7740 : }
7741 0 : __pyx_L3:;
7742 :
7743 : /* "View.MemoryView":278
7744 : * result.data = buf
7745 : *
7746 : * return result # <<<<<<<<<<<<<<
7747 : *
7748 : *
7749 : */
7750 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
7751 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
7752 0 : __pyx_r = __pyx_v_result;
7753 0 : goto __pyx_L0;
7754 :
7755 : /* "View.MemoryView":268
7756 : *
7757 : * @cname("__pyx_array_new")
7758 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
7759 : * cdef array result
7760 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
7761 : */
7762 :
7763 : /* function exit code */
7764 0 : __pyx_L1_error:;
7765 0 : __Pyx_XDECREF(__pyx_t_1);
7766 0 : __Pyx_XDECREF(__pyx_t_3);
7767 0 : __Pyx_XDECREF(__pyx_t_4);
7768 0 : __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
7769 0 : __pyx_r = 0;
7770 0 : __pyx_L0:;
7771 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
7772 0 : __Pyx_XDECREF(__pyx_v_mode);
7773 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
7774 0 : __Pyx_RefNannyFinishContext();
7775 0 : return __pyx_r;
7776 : }
7777 :
7778 : /* "View.MemoryView":304
7779 : * cdef class Enum(object):
7780 : * cdef object name
7781 : * def __init__(self, name): # <<<<<<<<<<<<<<
7782 : * self.name = name
7783 : * def __repr__(self):
7784 : */
7785 :
7786 : /* Python wrapper */
7787 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7788 15 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7789 15 : PyObject *__pyx_v_name = 0;
7790 15 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7791 15 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7792 15 : PyObject* values[1] = {0};
7793 15 : int __pyx_lineno = 0;
7794 15 : const char *__pyx_filename = NULL;
7795 15 : int __pyx_clineno = 0;
7796 15 : int __pyx_r;
7797 : __Pyx_RefNannyDeclarations
7798 15 : __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
7799 : #if CYTHON_ASSUME_SAFE_MACROS
7800 15 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7801 : #else
7802 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7803 : #endif
7804 15 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7805 15 : {
7806 15 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
7807 15 : if (__pyx_kwds) {
7808 0 : Py_ssize_t kw_args;
7809 0 : switch (__pyx_nargs) {
7810 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7811 0 : CYTHON_FALLTHROUGH;
7812 0 : case 0: break;
7813 0 : default: goto __pyx_L5_argtuple_error;
7814 : }
7815 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
7816 0 : switch (__pyx_nargs) {
7817 0 : case 0:
7818 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
7819 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
7820 0 : kw_args--;
7821 : }
7822 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __pyx_L3_error)
7823 0 : else goto __pyx_L5_argtuple_error;
7824 : }
7825 0 : if (unlikely(kw_args > 0)) {
7826 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7827 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 304, __pyx_L3_error)
7828 : }
7829 15 : } else if (unlikely(__pyx_nargs != 1)) {
7830 0 : goto __pyx_L5_argtuple_error;
7831 : } else {
7832 15 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7833 : }
7834 15 : __pyx_v_name = values[0];
7835 : }
7836 15 : goto __pyx_L6_skip;
7837 0 : __pyx_L5_argtuple_error:;
7838 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 304, __pyx_L3_error)
7839 15 : __pyx_L6_skip:;
7840 15 : goto __pyx_L4_argument_unpacking_done;
7841 0 : __pyx_L3_error:;
7842 0 : {
7843 0 : Py_ssize_t __pyx_temp;
7844 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7845 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7846 : }
7847 : }
7848 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7849 : __Pyx_RefNannyFinishContext();
7850 : return -1;
7851 15 : __pyx_L4_argument_unpacking_done:;
7852 15 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
7853 :
7854 : /* function exit code */
7855 : {
7856 : Py_ssize_t __pyx_temp;
7857 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7858 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7859 : }
7860 : }
7861 : __Pyx_RefNannyFinishContext();
7862 : return __pyx_r;
7863 : }
7864 :
7865 15 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
7866 15 : int __pyx_r;
7867 : __Pyx_RefNannyDeclarations
7868 15 : __Pyx_RefNannySetupContext("__init__", 1);
7869 :
7870 : /* "View.MemoryView":305
7871 : * cdef object name
7872 : * def __init__(self, name):
7873 : * self.name = name # <<<<<<<<<<<<<<
7874 : * def __repr__(self):
7875 : * return self.name
7876 : */
7877 15 : __Pyx_INCREF(__pyx_v_name);
7878 15 : __Pyx_GIVEREF(__pyx_v_name);
7879 15 : __Pyx_GOTREF(__pyx_v_self->name);
7880 15 : __Pyx_DECREF(__pyx_v_self->name);
7881 15 : __pyx_v_self->name = __pyx_v_name;
7882 :
7883 : /* "View.MemoryView":304
7884 : * cdef class Enum(object):
7885 : * cdef object name
7886 : * def __init__(self, name): # <<<<<<<<<<<<<<
7887 : * self.name = name
7888 : * def __repr__(self):
7889 : */
7890 :
7891 : /* function exit code */
7892 15 : __pyx_r = 0;
7893 15 : __Pyx_RefNannyFinishContext();
7894 15 : return __pyx_r;
7895 : }
7896 :
7897 : /* "View.MemoryView":306
7898 : * def __init__(self, name):
7899 : * self.name = name
7900 : * def __repr__(self): # <<<<<<<<<<<<<<
7901 : * return self.name
7902 : *
7903 : */
7904 :
7905 : /* Python wrapper */
7906 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
7907 0 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
7908 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7909 0 : PyObject *__pyx_r = 0;
7910 : __Pyx_RefNannyDeclarations
7911 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
7912 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7913 0 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7914 :
7915 : /* function exit code */
7916 0 : __Pyx_RefNannyFinishContext();
7917 0 : return __pyx_r;
7918 : }
7919 :
7920 0 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7921 0 : PyObject *__pyx_r = NULL;
7922 : __Pyx_RefNannyDeclarations
7923 0 : __Pyx_RefNannySetupContext("__repr__", 1);
7924 :
7925 : /* "View.MemoryView":307
7926 : * self.name = name
7927 : * def __repr__(self):
7928 : * return self.name # <<<<<<<<<<<<<<
7929 : *
7930 : * cdef generic = Enum("<strided and direct or indirect>")
7931 : */
7932 0 : __Pyx_XDECREF(__pyx_r);
7933 0 : __Pyx_INCREF(__pyx_v_self->name);
7934 0 : __pyx_r = __pyx_v_self->name;
7935 0 : goto __pyx_L0;
7936 :
7937 : /* "View.MemoryView":306
7938 : * def __init__(self, name):
7939 : * self.name = name
7940 : * def __repr__(self): # <<<<<<<<<<<<<<
7941 : * return self.name
7942 : *
7943 : */
7944 :
7945 : /* function exit code */
7946 0 : __pyx_L0:;
7947 0 : __Pyx_XGIVEREF(__pyx_r);
7948 0 : __Pyx_RefNannyFinishContext();
7949 0 : return __pyx_r;
7950 : }
7951 :
7952 : /* "(tree fragment)":1
7953 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7954 : * cdef tuple state
7955 : * cdef object _dict
7956 : */
7957 :
7958 : /* Python wrapper */
7959 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7960 : #if CYTHON_METH_FASTCALL
7961 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7962 : #else
7963 : PyObject *__pyx_args, PyObject *__pyx_kwds
7964 : #endif
7965 : ); /*proto*/
7966 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7967 : #if CYTHON_METH_FASTCALL
7968 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7969 : #else
7970 : PyObject *__pyx_args, PyObject *__pyx_kwds
7971 : #endif
7972 : ) {
7973 : #if !CYTHON_METH_FASTCALL
7974 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7975 : #endif
7976 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7977 0 : PyObject *__pyx_r = 0;
7978 : __Pyx_RefNannyDeclarations
7979 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7980 : #if !CYTHON_METH_FASTCALL
7981 : #if CYTHON_ASSUME_SAFE_MACROS
7982 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7983 : #else
7984 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7985 : #endif
7986 : #endif
7987 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7988 0 : if (unlikely(__pyx_nargs > 0)) {
7989 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7990 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7991 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7992 :
7993 : /* function exit code */
7994 0 : __Pyx_RefNannyFinishContext();
7995 0 : return __pyx_r;
7996 : }
7997 :
7998 0 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7999 0 : PyObject *__pyx_v_state = 0;
8000 0 : PyObject *__pyx_v__dict = 0;
8001 0 : int __pyx_v_use_setstate;
8002 0 : PyObject *__pyx_r = NULL;
8003 : __Pyx_RefNannyDeclarations
8004 0 : PyObject *__pyx_t_1 = NULL;
8005 0 : int __pyx_t_2;
8006 0 : PyObject *__pyx_t_3 = NULL;
8007 0 : PyObject *__pyx_t_4 = NULL;
8008 0 : int __pyx_lineno = 0;
8009 0 : const char *__pyx_filename = NULL;
8010 0 : int __pyx_clineno = 0;
8011 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
8012 :
8013 : /* "(tree fragment)":5
8014 : * cdef object _dict
8015 : * cdef bint use_setstate
8016 : * state = (self.name,) # <<<<<<<<<<<<<<
8017 : * _dict = getattr(self, '__dict__', None)
8018 : * if _dict is not None:
8019 : */
8020 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
8021 0 : __Pyx_GOTREF(__pyx_t_1);
8022 0 : __Pyx_INCREF(__pyx_v_self->name);
8023 0 : __Pyx_GIVEREF(__pyx_v_self->name);
8024 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(1, 5, __pyx_L1_error);
8025 0 : __pyx_v_state = ((PyObject*)__pyx_t_1);
8026 0 : __pyx_t_1 = 0;
8027 :
8028 : /* "(tree fragment)":6
8029 : * cdef bint use_setstate
8030 : * state = (self.name,)
8031 : * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
8032 : * if _dict is not None:
8033 : * state += (_dict,)
8034 : */
8035 0 : __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
8036 0 : __Pyx_GOTREF(__pyx_t_1);
8037 0 : __pyx_v__dict = __pyx_t_1;
8038 0 : __pyx_t_1 = 0;
8039 :
8040 : /* "(tree fragment)":7
8041 : * state = (self.name,)
8042 : * _dict = getattr(self, '__dict__', None)
8043 : * if _dict is not None: # <<<<<<<<<<<<<<
8044 : * state += (_dict,)
8045 : * use_setstate = True
8046 : */
8047 0 : __pyx_t_2 = (__pyx_v__dict != Py_None);
8048 0 : if (__pyx_t_2) {
8049 :
8050 : /* "(tree fragment)":8
8051 : * _dict = getattr(self, '__dict__', None)
8052 : * if _dict is not None:
8053 : * state += (_dict,) # <<<<<<<<<<<<<<
8054 : * use_setstate = True
8055 : * else:
8056 : */
8057 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
8058 0 : __Pyx_GOTREF(__pyx_t_1);
8059 0 : __Pyx_INCREF(__pyx_v__dict);
8060 0 : __Pyx_GIVEREF(__pyx_v__dict);
8061 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error);
8062 0 : __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
8063 0 : __Pyx_GOTREF(__pyx_t_3);
8064 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8065 0 : __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
8066 0 : __pyx_t_3 = 0;
8067 :
8068 : /* "(tree fragment)":9
8069 : * if _dict is not None:
8070 : * state += (_dict,)
8071 : * use_setstate = True # <<<<<<<<<<<<<<
8072 : * else:
8073 : * use_setstate = self.name is not None
8074 : */
8075 0 : __pyx_v_use_setstate = 1;
8076 :
8077 : /* "(tree fragment)":7
8078 : * state = (self.name,)
8079 : * _dict = getattr(self, '__dict__', None)
8080 : * if _dict is not None: # <<<<<<<<<<<<<<
8081 : * state += (_dict,)
8082 : * use_setstate = True
8083 : */
8084 0 : goto __pyx_L3;
8085 : }
8086 :
8087 : /* "(tree fragment)":11
8088 : * use_setstate = True
8089 : * else:
8090 : * use_setstate = self.name is not None # <<<<<<<<<<<<<<
8091 : * if use_setstate:
8092 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
8093 : */
8094 0 : /*else*/ {
8095 0 : __pyx_t_2 = (__pyx_v_self->name != Py_None);
8096 0 : __pyx_v_use_setstate = __pyx_t_2;
8097 : }
8098 0 : __pyx_L3:;
8099 :
8100 : /* "(tree fragment)":12
8101 : * else:
8102 : * use_setstate = self.name is not None
8103 : * if use_setstate: # <<<<<<<<<<<<<<
8104 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
8105 : * else:
8106 : */
8107 0 : if (__pyx_v_use_setstate) {
8108 :
8109 : /* "(tree fragment)":13
8110 : * use_setstate = self.name is not None
8111 : * if use_setstate:
8112 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
8113 : * else:
8114 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8115 : */
8116 0 : __Pyx_XDECREF(__pyx_r);
8117 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
8118 0 : __Pyx_GOTREF(__pyx_t_3);
8119 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
8120 0 : __Pyx_GOTREF(__pyx_t_1);
8121 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8122 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8123 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error);
8124 0 : __Pyx_INCREF(__pyx_int_136983863);
8125 0 : __Pyx_GIVEREF(__pyx_int_136983863);
8126 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 13, __pyx_L1_error);
8127 0 : __Pyx_INCREF(Py_None);
8128 0 : __Pyx_GIVEREF(Py_None);
8129 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error);
8130 0 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
8131 0 : __Pyx_GOTREF(__pyx_t_4);
8132 0 : __Pyx_GIVEREF(__pyx_t_3);
8133 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error);
8134 0 : __Pyx_GIVEREF(__pyx_t_1);
8135 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error);
8136 0 : __Pyx_INCREF(__pyx_v_state);
8137 0 : __Pyx_GIVEREF(__pyx_v_state);
8138 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error);
8139 0 : __pyx_t_3 = 0;
8140 0 : __pyx_t_1 = 0;
8141 0 : __pyx_r = __pyx_t_4;
8142 0 : __pyx_t_4 = 0;
8143 0 : goto __pyx_L0;
8144 :
8145 : /* "(tree fragment)":12
8146 : * else:
8147 : * use_setstate = self.name is not None
8148 : * if use_setstate: # <<<<<<<<<<<<<<
8149 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
8150 : * else:
8151 : */
8152 : }
8153 :
8154 : /* "(tree fragment)":15
8155 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
8156 : * else:
8157 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
8158 : * def __setstate_cython__(self, __pyx_state):
8159 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8160 : */
8161 0 : /*else*/ {
8162 0 : __Pyx_XDECREF(__pyx_r);
8163 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
8164 0 : __Pyx_GOTREF(__pyx_t_4);
8165 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
8166 0 : __Pyx_GOTREF(__pyx_t_1);
8167 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8168 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8169 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error);
8170 0 : __Pyx_INCREF(__pyx_int_136983863);
8171 0 : __Pyx_GIVEREF(__pyx_int_136983863);
8172 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 15, __pyx_L1_error);
8173 0 : __Pyx_INCREF(__pyx_v_state);
8174 0 : __Pyx_GIVEREF(__pyx_v_state);
8175 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error);
8176 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
8177 0 : __Pyx_GOTREF(__pyx_t_3);
8178 0 : __Pyx_GIVEREF(__pyx_t_4);
8179 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error);
8180 0 : __Pyx_GIVEREF(__pyx_t_1);
8181 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error);
8182 0 : __pyx_t_4 = 0;
8183 0 : __pyx_t_1 = 0;
8184 0 : __pyx_r = __pyx_t_3;
8185 0 : __pyx_t_3 = 0;
8186 0 : goto __pyx_L0;
8187 : }
8188 :
8189 : /* "(tree fragment)":1
8190 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8191 : * cdef tuple state
8192 : * cdef object _dict
8193 : */
8194 :
8195 : /* function exit code */
8196 0 : __pyx_L1_error:;
8197 0 : __Pyx_XDECREF(__pyx_t_1);
8198 0 : __Pyx_XDECREF(__pyx_t_3);
8199 0 : __Pyx_XDECREF(__pyx_t_4);
8200 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8201 0 : __pyx_r = NULL;
8202 0 : __pyx_L0:;
8203 0 : __Pyx_XDECREF(__pyx_v_state);
8204 0 : __Pyx_XDECREF(__pyx_v__dict);
8205 0 : __Pyx_XGIVEREF(__pyx_r);
8206 0 : __Pyx_RefNannyFinishContext();
8207 0 : return __pyx_r;
8208 : }
8209 :
8210 : /* "(tree fragment)":16
8211 : * else:
8212 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8213 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8214 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8215 : */
8216 :
8217 : /* Python wrapper */
8218 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
8219 : #if CYTHON_METH_FASTCALL
8220 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8221 : #else
8222 : PyObject *__pyx_args, PyObject *__pyx_kwds
8223 : #endif
8224 : ); /*proto*/
8225 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
8226 : #if CYTHON_METH_FASTCALL
8227 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
8228 : #else
8229 : PyObject *__pyx_args, PyObject *__pyx_kwds
8230 : #endif
8231 : ) {
8232 0 : PyObject *__pyx_v___pyx_state = 0;
8233 : #if !CYTHON_METH_FASTCALL
8234 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8235 : #endif
8236 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8237 0 : PyObject* values[1] = {0};
8238 0 : int __pyx_lineno = 0;
8239 0 : const char *__pyx_filename = NULL;
8240 0 : int __pyx_clineno = 0;
8241 0 : PyObject *__pyx_r = 0;
8242 : __Pyx_RefNannyDeclarations
8243 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8244 : #if !CYTHON_METH_FASTCALL
8245 : #if CYTHON_ASSUME_SAFE_MACROS
8246 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8247 : #else
8248 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
8249 : #endif
8250 : #endif
8251 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
8252 0 : {
8253 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
8254 0 : if (__pyx_kwds) {
8255 0 : Py_ssize_t kw_args;
8256 0 : switch (__pyx_nargs) {
8257 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
8258 0 : CYTHON_FALLTHROUGH;
8259 0 : case 0: break;
8260 0 : default: goto __pyx_L5_argtuple_error;
8261 : }
8262 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
8263 0 : switch (__pyx_nargs) {
8264 0 : case 0:
8265 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
8266 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
8267 0 : kw_args--;
8268 : }
8269 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
8270 0 : else goto __pyx_L5_argtuple_error;
8271 : }
8272 0 : if (unlikely(kw_args > 0)) {
8273 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
8274 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
8275 : }
8276 0 : } else if (unlikely(__pyx_nargs != 1)) {
8277 0 : goto __pyx_L5_argtuple_error;
8278 : } else {
8279 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
8280 : }
8281 0 : __pyx_v___pyx_state = values[0];
8282 : }
8283 0 : goto __pyx_L6_skip;
8284 0 : __pyx_L5_argtuple_error:;
8285 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
8286 0 : __pyx_L6_skip:;
8287 0 : goto __pyx_L4_argument_unpacking_done;
8288 0 : __pyx_L3_error:;
8289 0 : {
8290 0 : Py_ssize_t __pyx_temp;
8291 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8292 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
8293 : }
8294 : }
8295 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8296 : __Pyx_RefNannyFinishContext();
8297 : return NULL;
8298 0 : __pyx_L4_argument_unpacking_done:;
8299 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
8300 :
8301 : /* function exit code */
8302 : {
8303 : Py_ssize_t __pyx_temp;
8304 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8305 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
8306 : }
8307 : }
8308 : __Pyx_RefNannyFinishContext();
8309 : return __pyx_r;
8310 : }
8311 :
8312 0 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8313 0 : PyObject *__pyx_r = NULL;
8314 : __Pyx_RefNannyDeclarations
8315 0 : PyObject *__pyx_t_1 = NULL;
8316 0 : int __pyx_lineno = 0;
8317 0 : const char *__pyx_filename = NULL;
8318 0 : int __pyx_clineno = 0;
8319 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
8320 :
8321 : /* "(tree fragment)":17
8322 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8323 : * def __setstate_cython__(self, __pyx_state):
8324 : * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
8325 : */
8326 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
8327 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
8328 0 : __Pyx_GOTREF(__pyx_t_1);
8329 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8330 :
8331 : /* "(tree fragment)":16
8332 : * else:
8333 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
8334 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8335 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
8336 : */
8337 :
8338 : /* function exit code */
8339 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8340 0 : goto __pyx_L0;
8341 0 : __pyx_L1_error:;
8342 0 : __Pyx_XDECREF(__pyx_t_1);
8343 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8344 0 : __pyx_r = NULL;
8345 0 : __pyx_L0:;
8346 0 : __Pyx_XGIVEREF(__pyx_r);
8347 0 : __Pyx_RefNannyFinishContext();
8348 0 : return __pyx_r;
8349 : }
8350 :
8351 : /* "View.MemoryView":349
8352 : * cdef __Pyx_TypeInfo *typeinfo
8353 : *
8354 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8355 : * self.obj = obj
8356 : * self.flags = flags
8357 : */
8358 :
8359 : /* Python wrapper */
8360 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8361 78202 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8362 78202 : PyObject *__pyx_v_obj = 0;
8363 78202 : int __pyx_v_flags;
8364 78202 : int __pyx_v_dtype_is_object;
8365 78202 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
8366 78202 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8367 78202 : PyObject* values[3] = {0,0,0};
8368 78202 : int __pyx_lineno = 0;
8369 78202 : const char *__pyx_filename = NULL;
8370 78202 : int __pyx_clineno = 0;
8371 78202 : int __pyx_r;
8372 : __Pyx_RefNannyDeclarations
8373 78202 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8374 : #if CYTHON_ASSUME_SAFE_MACROS
8375 78202 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
8376 : #else
8377 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
8378 : #endif
8379 78202 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8380 78202 : {
8381 78202 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
8382 78202 : if (__pyx_kwds) {
8383 0 : Py_ssize_t kw_args;
8384 0 : switch (__pyx_nargs) {
8385 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
8386 0 : CYTHON_FALLTHROUGH;
8387 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
8388 0 : CYTHON_FALLTHROUGH;
8389 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
8390 0 : CYTHON_FALLTHROUGH;
8391 0 : case 0: break;
8392 0 : default: goto __pyx_L5_argtuple_error;
8393 : }
8394 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
8395 0 : switch (__pyx_nargs) {
8396 0 : case 0:
8397 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
8398 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
8399 0 : kw_args--;
8400 : }
8401 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8402 0 : else goto __pyx_L5_argtuple_error;
8403 0 : CYTHON_FALLTHROUGH;
8404 0 : case 1:
8405 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) {
8406 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
8407 0 : kw_args--;
8408 : }
8409 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8410 : else {
8411 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 349, __pyx_L3_error)
8412 : }
8413 0 : CYTHON_FALLTHROUGH;
8414 0 : case 2:
8415 0 : if (kw_args > 0) {
8416 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
8417 0 : if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
8418 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8419 : }
8420 : }
8421 0 : if (unlikely(kw_args > 0)) {
8422 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
8423 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 349, __pyx_L3_error)
8424 : }
8425 : } else {
8426 78202 : switch (__pyx_nargs) {
8427 78202 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
8428 78202 : CYTHON_FALLTHROUGH;
8429 78202 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
8430 78202 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
8431 78202 : break;
8432 0 : default: goto __pyx_L5_argtuple_error;
8433 : }
8434 : }
8435 78202 : __pyx_v_obj = values[0];
8436 78202 : __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8437 78202 : if (values[2]) {
8438 78202 : __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
8439 : } else {
8440 : __pyx_v_dtype_is_object = ((int)0);
8441 : }
8442 : }
8443 78202 : goto __pyx_L6_skip;
8444 0 : __pyx_L5_argtuple_error:;
8445 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 349, __pyx_L3_error)
8446 78202 : __pyx_L6_skip:;
8447 78202 : goto __pyx_L4_argument_unpacking_done;
8448 0 : __pyx_L3_error:;
8449 0 : {
8450 0 : Py_ssize_t __pyx_temp;
8451 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8452 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
8453 : }
8454 : }
8455 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8456 : __Pyx_RefNannyFinishContext();
8457 : return -1;
8458 78202 : __pyx_L4_argument_unpacking_done:;
8459 78202 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
8460 :
8461 : /* function exit code */
8462 : {
8463 : Py_ssize_t __pyx_temp;
8464 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
8465 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
8466 : }
8467 : }
8468 : __Pyx_RefNannyFinishContext();
8469 : return __pyx_r;
8470 : }
8471 :
8472 78202 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
8473 78202 : int __pyx_r;
8474 : __Pyx_RefNannyDeclarations
8475 78202 : int __pyx_t_1;
8476 78202 : int __pyx_t_2;
8477 78202 : int __pyx_t_3;
8478 78202 : Py_intptr_t __pyx_t_4;
8479 78202 : size_t __pyx_t_5;
8480 78202 : int __pyx_lineno = 0;
8481 78202 : const char *__pyx_filename = NULL;
8482 78202 : int __pyx_clineno = 0;
8483 78202 : __Pyx_RefNannySetupContext("__cinit__", 1);
8484 :
8485 : /* "View.MemoryView":350
8486 : *
8487 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8488 : * self.obj = obj # <<<<<<<<<<<<<<
8489 : * self.flags = flags
8490 : * if type(self) is memoryview or obj is not None:
8491 : */
8492 78202 : __Pyx_INCREF(__pyx_v_obj);
8493 78202 : __Pyx_GIVEREF(__pyx_v_obj);
8494 78202 : __Pyx_GOTREF(__pyx_v_self->obj);
8495 78202 : __Pyx_DECREF(__pyx_v_self->obj);
8496 78202 : __pyx_v_self->obj = __pyx_v_obj;
8497 :
8498 : /* "View.MemoryView":351
8499 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
8500 : * self.obj = obj
8501 : * self.flags = flags # <<<<<<<<<<<<<<
8502 : * if type(self) is memoryview or obj is not None:
8503 : * __Pyx_GetBuffer(obj, &self.view, flags)
8504 : */
8505 78202 : __pyx_v_self->flags = __pyx_v_flags;
8506 :
8507 : /* "View.MemoryView":352
8508 : * self.obj = obj
8509 : * self.flags = flags
8510 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8511 : * __Pyx_GetBuffer(obj, &self.view, flags)
8512 : * if <PyObject *> self.view.obj == NULL:
8513 : */
8514 78202 : __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
8515 78202 : if (!__pyx_t_2) {
8516 : } else {
8517 75718 : __pyx_t_1 = __pyx_t_2;
8518 75718 : goto __pyx_L4_bool_binop_done;
8519 : }
8520 2484 : __pyx_t_2 = (__pyx_v_obj != Py_None);
8521 2484 : __pyx_t_1 = __pyx_t_2;
8522 78202 : __pyx_L4_bool_binop_done:;
8523 78202 : if (__pyx_t_1) {
8524 :
8525 : /* "View.MemoryView":353
8526 : * self.flags = flags
8527 : * if type(self) is memoryview or obj is not None:
8528 : * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
8529 : * if <PyObject *> self.view.obj == NULL:
8530 : * (<__pyx_buffer *> &self.view).obj = Py_None
8531 : */
8532 75718 : __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
8533 :
8534 : /* "View.MemoryView":354
8535 : * if type(self) is memoryview or obj is not None:
8536 : * __Pyx_GetBuffer(obj, &self.view, flags)
8537 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8538 : * (<__pyx_buffer *> &self.view).obj = Py_None
8539 : * Py_INCREF(Py_None)
8540 : */
8541 75718 : __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
8542 75718 : if (__pyx_t_1) {
8543 :
8544 : /* "View.MemoryView":355
8545 : * __Pyx_GetBuffer(obj, &self.view, flags)
8546 : * if <PyObject *> self.view.obj == NULL:
8547 : * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
8548 : * Py_INCREF(Py_None)
8549 : *
8550 : */
8551 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
8552 :
8553 : /* "View.MemoryView":356
8554 : * if <PyObject *> self.view.obj == NULL:
8555 : * (<__pyx_buffer *> &self.view).obj = Py_None
8556 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8557 : *
8558 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
8559 : */
8560 0 : Py_INCREF(Py_None);
8561 :
8562 : /* "View.MemoryView":354
8563 : * if type(self) is memoryview or obj is not None:
8564 : * __Pyx_GetBuffer(obj, &self.view, flags)
8565 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
8566 : * (<__pyx_buffer *> &self.view).obj = Py_None
8567 : * Py_INCREF(Py_None)
8568 : */
8569 : }
8570 :
8571 : /* "View.MemoryView":352
8572 : * self.obj = obj
8573 : * self.flags = flags
8574 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
8575 : * __Pyx_GetBuffer(obj, &self.view, flags)
8576 : * if <PyObject *> self.view.obj == NULL:
8577 : */
8578 : }
8579 :
8580 : /* "View.MemoryView":358
8581 : * Py_INCREF(Py_None)
8582 : *
8583 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8584 : * global __pyx_memoryview_thread_locks_used
8585 : * if __pyx_memoryview_thread_locks_used < 8:
8586 : */
8587 78202 : __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
8588 78202 : if (__pyx_t_1) {
8589 :
8590 : /* "View.MemoryView":360
8591 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
8592 : * global __pyx_memoryview_thread_locks_used
8593 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
8594 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8595 : * __pyx_memoryview_thread_locks_used += 1
8596 : */
8597 : __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
8598 : if (__pyx_t_1) {
8599 :
8600 : /* "View.MemoryView":361
8601 : * global __pyx_memoryview_thread_locks_used
8602 : * if __pyx_memoryview_thread_locks_used < 8:
8603 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
8604 : * __pyx_memoryview_thread_locks_used += 1
8605 : * if self.lock is NULL:
8606 : */
8607 : __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8608 :
8609 : /* "View.MemoryView":362
8610 : * if __pyx_memoryview_thread_locks_used < 8:
8611 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8612 : * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
8613 : * if self.lock is NULL:
8614 : * self.lock = PyThread_allocate_lock()
8615 : */
8616 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
8617 :
8618 : /* "View.MemoryView":360
8619 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
8620 : * global __pyx_memoryview_thread_locks_used
8621 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
8622 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8623 : * __pyx_memoryview_thread_locks_used += 1
8624 : */
8625 : }
8626 :
8627 : /* "View.MemoryView":363
8628 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8629 : * __pyx_memoryview_thread_locks_used += 1
8630 : * if self.lock is NULL: # <<<<<<<<<<<<<<
8631 : * self.lock = PyThread_allocate_lock()
8632 : * if self.lock is NULL:
8633 : */
8634 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
8635 : if (__pyx_t_1) {
8636 :
8637 : /* "View.MemoryView":364
8638 : * __pyx_memoryview_thread_locks_used += 1
8639 : * if self.lock is NULL:
8640 : * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
8641 : * if self.lock is NULL:
8642 : * raise MemoryError
8643 : */
8644 : __pyx_v_self->lock = PyThread_allocate_lock();
8645 :
8646 : /* "View.MemoryView":365
8647 : * if self.lock is NULL:
8648 : * self.lock = PyThread_allocate_lock()
8649 : * if self.lock is NULL: # <<<<<<<<<<<<<<
8650 : * raise MemoryError
8651 : *
8652 : */
8653 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
8654 : if (unlikely(__pyx_t_1)) {
8655 :
8656 : /* "View.MemoryView":366
8657 : * self.lock = PyThread_allocate_lock()
8658 : * if self.lock is NULL:
8659 : * raise MemoryError # <<<<<<<<<<<<<<
8660 : *
8661 : * if flags & PyBUF_FORMAT:
8662 : */
8663 : PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
8664 :
8665 : /* "View.MemoryView":365
8666 : * if self.lock is NULL:
8667 : * self.lock = PyThread_allocate_lock()
8668 : * if self.lock is NULL: # <<<<<<<<<<<<<<
8669 : * raise MemoryError
8670 : *
8671 : */
8672 : }
8673 :
8674 : /* "View.MemoryView":363
8675 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
8676 : * __pyx_memoryview_thread_locks_used += 1
8677 : * if self.lock is NULL: # <<<<<<<<<<<<<<
8678 : * self.lock = PyThread_allocate_lock()
8679 : * if self.lock is NULL:
8680 : */
8681 : }
8682 :
8683 : /* "View.MemoryView":358
8684 : * Py_INCREF(Py_None)
8685 : *
8686 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
8687 : * global __pyx_memoryview_thread_locks_used
8688 : * if __pyx_memoryview_thread_locks_used < 8:
8689 : */
8690 : }
8691 :
8692 : /* "View.MemoryView":368
8693 : * raise MemoryError
8694 : *
8695 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8696 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8697 : * else:
8698 : */
8699 78202 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8700 78202 : if (__pyx_t_1) {
8701 :
8702 : /* "View.MemoryView":369
8703 : *
8704 : * if flags & PyBUF_FORMAT:
8705 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
8706 : * else:
8707 : * self.dtype_is_object = dtype_is_object
8708 : */
8709 75718 : __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
8710 75718 : if (__pyx_t_2) {
8711 : } else {
8712 75718 : __pyx_t_1 = __pyx_t_2;
8713 75718 : goto __pyx_L12_bool_binop_done;
8714 : }
8715 0 : __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
8716 0 : __pyx_t_1 = __pyx_t_2;
8717 75718 : __pyx_L12_bool_binop_done:;
8718 75718 : __pyx_v_self->dtype_is_object = __pyx_t_1;
8719 :
8720 : /* "View.MemoryView":368
8721 : * raise MemoryError
8722 : *
8723 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8724 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8725 : * else:
8726 : */
8727 75718 : goto __pyx_L11;
8728 : }
8729 :
8730 : /* "View.MemoryView":371
8731 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
8732 : * else:
8733 : * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
8734 : *
8735 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8736 : */
8737 2484 : /*else*/ {
8738 2484 : __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
8739 : }
8740 78202 : __pyx_L11:;
8741 :
8742 : /* "View.MemoryView":373
8743 : * self.dtype_is_object = dtype_is_object
8744 : *
8745 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
8746 : * self.typeinfo = NULL
8747 : *
8748 : */
8749 : #ifndef CYTHON_WITHOUT_ASSERTIONS
8750 78202 : if (unlikely(__pyx_assertions_enabled())) {
8751 78202 : __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
8752 78202 : __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
8753 78202 : if (unlikely(__pyx_t_5 == 0)) {
8754 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8755 : __PYX_ERR(1, 373, __pyx_L1_error)
8756 : }
8757 78202 : __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
8758 78202 : if (unlikely(!__pyx_t_1)) {
8759 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
8760 0 : __PYX_ERR(1, 373, __pyx_L1_error)
8761 : }
8762 : }
8763 : #else
8764 : if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
8765 : #endif
8766 :
8767 : /* "View.MemoryView":374
8768 : *
8769 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
8770 : * self.typeinfo = NULL # <<<<<<<<<<<<<<
8771 : *
8772 : * def __dealloc__(memoryview self):
8773 : */
8774 78202 : __pyx_v_self->typeinfo = NULL;
8775 :
8776 : /* "View.MemoryView":349
8777 : * cdef __Pyx_TypeInfo *typeinfo
8778 : *
8779 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
8780 : * self.obj = obj
8781 : * self.flags = flags
8782 : */
8783 :
8784 : /* function exit code */
8785 78202 : __pyx_r = 0;
8786 78202 : goto __pyx_L0;
8787 0 : __pyx_L1_error:;
8788 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8789 0 : __pyx_r = -1;
8790 78202 : __pyx_L0:;
8791 78202 : __Pyx_RefNannyFinishContext();
8792 78202 : return __pyx_r;
8793 : }
8794 :
8795 : /* "View.MemoryView":376
8796 : * self.typeinfo = NULL
8797 : *
8798 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8799 : * if self.obj is not None:
8800 : * __Pyx_ReleaseBuffer(&self.view)
8801 : */
8802 :
8803 : /* Python wrapper */
8804 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
8805 78202 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
8806 78202 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8807 : __Pyx_RefNannyDeclarations
8808 78202 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8809 78202 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8810 78202 : __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
8811 :
8812 : /* function exit code */
8813 78202 : __Pyx_RefNannyFinishContext();
8814 : }
8815 :
8816 78202 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
8817 78202 : int __pyx_v_i;
8818 78202 : int __pyx_t_1;
8819 78202 : int __pyx_t_2;
8820 78202 : int __pyx_t_3;
8821 78202 : int __pyx_t_4;
8822 78202 : PyThread_type_lock __pyx_t_5;
8823 78202 : PyThread_type_lock __pyx_t_6;
8824 :
8825 : /* "View.MemoryView":377
8826 : *
8827 : * def __dealloc__(memoryview self):
8828 : * if self.obj is not None: # <<<<<<<<<<<<<<
8829 : * __Pyx_ReleaseBuffer(&self.view)
8830 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8831 : */
8832 78202 : __pyx_t_1 = (__pyx_v_self->obj != Py_None);
8833 78202 : if (__pyx_t_1) {
8834 :
8835 : /* "View.MemoryView":378
8836 : * def __dealloc__(memoryview self):
8837 : * if self.obj is not None:
8838 : * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
8839 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8840 : *
8841 : */
8842 75718 : __Pyx_ReleaseBuffer((&__pyx_v_self->view));
8843 :
8844 : /* "View.MemoryView":377
8845 : *
8846 : * def __dealloc__(memoryview self):
8847 : * if self.obj is not None: # <<<<<<<<<<<<<<
8848 : * __Pyx_ReleaseBuffer(&self.view)
8849 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8850 : */
8851 75718 : goto __pyx_L3;
8852 : }
8853 :
8854 : /* "View.MemoryView":379
8855 : * if self.obj is not None:
8856 : * __Pyx_ReleaseBuffer(&self.view)
8857 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8858 : *
8859 : * (<__pyx_buffer *> &self.view).obj = NULL
8860 : */
8861 2484 : __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
8862 2484 : if (__pyx_t_1) {
8863 :
8864 : /* "View.MemoryView":381
8865 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
8866 : *
8867 : * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
8868 : * Py_DECREF(Py_None)
8869 : *
8870 : */
8871 2484 : ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
8872 :
8873 : /* "View.MemoryView":382
8874 : *
8875 : * (<__pyx_buffer *> &self.view).obj = NULL
8876 : * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
8877 : *
8878 : * cdef int i
8879 : */
8880 2484 : Py_DECREF(Py_None);
8881 :
8882 : /* "View.MemoryView":379
8883 : * if self.obj is not None:
8884 : * __Pyx_ReleaseBuffer(&self.view)
8885 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
8886 : *
8887 : * (<__pyx_buffer *> &self.view).obj = NULL
8888 : */
8889 : }
8890 0 : __pyx_L3:;
8891 :
8892 : /* "View.MemoryView":386
8893 : * cdef int i
8894 : * global __pyx_memoryview_thread_locks_used
8895 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8896 : * for i in range(__pyx_memoryview_thread_locks_used):
8897 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8898 : */
8899 78202 : __pyx_t_1 = (__pyx_v_self->lock != NULL);
8900 78202 : if (__pyx_t_1) {
8901 :
8902 : /* "View.MemoryView":387
8903 : * global __pyx_memoryview_thread_locks_used
8904 : * if self.lock != NULL:
8905 : * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
8906 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8907 : * __pyx_memoryview_thread_locks_used -= 1
8908 : */
8909 0 : __pyx_t_2 = __pyx_memoryview_thread_locks_used;
8910 0 : __pyx_t_3 = __pyx_t_2;
8911 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
8912 0 : __pyx_v_i = __pyx_t_4;
8913 :
8914 : /* "View.MemoryView":388
8915 : * if self.lock != NULL:
8916 : * for i in range(__pyx_memoryview_thread_locks_used):
8917 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8918 : * __pyx_memoryview_thread_locks_used -= 1
8919 : * if i != __pyx_memoryview_thread_locks_used:
8920 : */
8921 0 : __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
8922 0 : if (__pyx_t_1) {
8923 :
8924 : /* "View.MemoryView":389
8925 : * for i in range(__pyx_memoryview_thread_locks_used):
8926 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8927 : * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
8928 : * if i != __pyx_memoryview_thread_locks_used:
8929 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8930 : */
8931 0 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8932 :
8933 : /* "View.MemoryView":390
8934 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8935 : * __pyx_memoryview_thread_locks_used -= 1
8936 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8937 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8938 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8939 : */
8940 0 : __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8941 0 : if (__pyx_t_1) {
8942 :
8943 : /* "View.MemoryView":392
8944 : * if i != __pyx_memoryview_thread_locks_used:
8945 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8946 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
8947 : * break
8948 : * else:
8949 : */
8950 0 : __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8951 0 : __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8952 :
8953 : /* "View.MemoryView":391
8954 : * __pyx_memoryview_thread_locks_used -= 1
8955 : * if i != __pyx_memoryview_thread_locks_used:
8956 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
8957 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8958 : * break
8959 : */
8960 0 : (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8961 0 : (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8962 :
8963 : /* "View.MemoryView":390
8964 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8965 : * __pyx_memoryview_thread_locks_used -= 1
8966 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8967 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8968 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8969 : */
8970 : }
8971 :
8972 : /* "View.MemoryView":393
8973 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8974 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8975 : * break # <<<<<<<<<<<<<<
8976 : * else:
8977 : * PyThread_free_lock(self.lock)
8978 : */
8979 0 : goto __pyx_L6_break;
8980 :
8981 : /* "View.MemoryView":388
8982 : * if self.lock != NULL:
8983 : * for i in range(__pyx_memoryview_thread_locks_used):
8984 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8985 : * __pyx_memoryview_thread_locks_used -= 1
8986 : * if i != __pyx_memoryview_thread_locks_used:
8987 : */
8988 : }
8989 : }
8990 0 : /*else*/ {
8991 :
8992 : /* "View.MemoryView":395
8993 : * break
8994 : * else:
8995 : * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8996 : *
8997 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8998 : */
8999 0 : PyThread_free_lock(__pyx_v_self->lock);
9000 : }
9001 78202 : __pyx_L6_break:;
9002 :
9003 : /* "View.MemoryView":386
9004 : * cdef int i
9005 : * global __pyx_memoryview_thread_locks_used
9006 : * if self.lock != NULL: # <<<<<<<<<<<<<<
9007 : * for i in range(__pyx_memoryview_thread_locks_used):
9008 : * if __pyx_memoryview_thread_locks[i] is self.lock:
9009 : */
9010 : }
9011 :
9012 : /* "View.MemoryView":376
9013 : * self.typeinfo = NULL
9014 : *
9015 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9016 : * if self.obj is not None:
9017 : * __Pyx_ReleaseBuffer(&self.view)
9018 : */
9019 :
9020 : /* function exit code */
9021 78202 : }
9022 :
9023 : /* "View.MemoryView":397
9024 : * PyThread_free_lock(self.lock)
9025 : *
9026 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9027 : * cdef Py_ssize_t dim
9028 : * cdef char *itemp = <char *> self.view.buf
9029 : */
9030 :
9031 2834 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9032 2834 : Py_ssize_t __pyx_v_dim;
9033 2834 : char *__pyx_v_itemp;
9034 2834 : PyObject *__pyx_v_idx = NULL;
9035 2834 : char *__pyx_r;
9036 : __Pyx_RefNannyDeclarations
9037 2834 : Py_ssize_t __pyx_t_1;
9038 2834 : PyObject *__pyx_t_2 = NULL;
9039 2834 : Py_ssize_t __pyx_t_3;
9040 2834 : PyObject *(*__pyx_t_4)(PyObject *);
9041 2834 : PyObject *__pyx_t_5 = NULL;
9042 2834 : Py_ssize_t __pyx_t_6;
9043 2834 : char *__pyx_t_7;
9044 2834 : int __pyx_lineno = 0;
9045 2834 : const char *__pyx_filename = NULL;
9046 2834 : int __pyx_clineno = 0;
9047 2834 : __Pyx_RefNannySetupContext("get_item_pointer", 1);
9048 :
9049 : /* "View.MemoryView":399
9050 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9051 : * cdef Py_ssize_t dim
9052 : * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
9053 : *
9054 : * for dim, idx in enumerate(index):
9055 : */
9056 2834 : __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
9057 :
9058 : /* "View.MemoryView":401
9059 : * cdef char *itemp = <char *> self.view.buf
9060 : *
9061 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9062 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9063 : *
9064 : */
9065 2834 : __pyx_t_1 = 0;
9066 2834 : if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
9067 2834 : __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
9068 2834 : __pyx_t_3 = 0;
9069 2834 : __pyx_t_4 = NULL;
9070 : } else {
9071 0 : __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
9072 0 : __Pyx_GOTREF(__pyx_t_2);
9073 0 : __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
9074 : }
9075 4976 : for (;;) {
9076 4976 : if (likely(!__pyx_t_4)) {
9077 4976 : if (likely(PyList_CheckExact(__pyx_t_2))) {
9078 0 : {
9079 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
9080 : #if !CYTHON_ASSUME_SAFE_MACROS
9081 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
9082 : #endif
9083 0 : if (__pyx_t_3 >= __pyx_temp) break;
9084 : }
9085 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9086 0 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
9087 : #else
9088 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
9089 : __Pyx_GOTREF(__pyx_t_5);
9090 : #endif
9091 : } else {
9092 4976 : {
9093 4976 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
9094 : #if !CYTHON_ASSUME_SAFE_MACROS
9095 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
9096 : #endif
9097 4976 : if (__pyx_t_3 >= __pyx_temp) break;
9098 : }
9099 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9100 2834 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
9101 : #else
9102 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
9103 : __Pyx_GOTREF(__pyx_t_5);
9104 : #endif
9105 : }
9106 : } else {
9107 0 : __pyx_t_5 = __pyx_t_4(__pyx_t_2);
9108 0 : if (unlikely(!__pyx_t_5)) {
9109 0 : PyObject* exc_type = PyErr_Occurred();
9110 0 : if (exc_type) {
9111 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9112 0 : else __PYX_ERR(1, 401, __pyx_L1_error)
9113 : }
9114 : break;
9115 : }
9116 2834 : __Pyx_GOTREF(__pyx_t_5);
9117 : }
9118 2834 : __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
9119 2834 : __pyx_t_5 = 0;
9120 2834 : __pyx_v_dim = __pyx_t_1;
9121 2834 : __pyx_t_1 = (__pyx_t_1 + 1);
9122 :
9123 : /* "View.MemoryView":402
9124 : *
9125 : * for dim, idx in enumerate(index):
9126 : * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
9127 : *
9128 : * return itemp
9129 : */
9130 2834 : __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
9131 2834 : __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 402, __pyx_L1_error)
9132 : __pyx_v_itemp = __pyx_t_7;
9133 :
9134 : /* "View.MemoryView":401
9135 : * cdef char *itemp = <char *> self.view.buf
9136 : *
9137 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
9138 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9139 : *
9140 : */
9141 : }
9142 2142 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9143 :
9144 : /* "View.MemoryView":404
9145 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
9146 : *
9147 : * return itemp # <<<<<<<<<<<<<<
9148 : *
9149 : *
9150 : */
9151 2142 : __pyx_r = __pyx_v_itemp;
9152 2142 : goto __pyx_L0;
9153 :
9154 : /* "View.MemoryView":397
9155 : * PyThread_free_lock(self.lock)
9156 : *
9157 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
9158 : * cdef Py_ssize_t dim
9159 : * cdef char *itemp = <char *> self.view.buf
9160 : */
9161 :
9162 : /* function exit code */
9163 692 : __pyx_L1_error:;
9164 692 : __Pyx_XDECREF(__pyx_t_2);
9165 692 : __Pyx_XDECREF(__pyx_t_5);
9166 692 : __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
9167 692 : __pyx_r = NULL;
9168 2834 : __pyx_L0:;
9169 2834 : __Pyx_XDECREF(__pyx_v_idx);
9170 2834 : __Pyx_RefNannyFinishContext();
9171 2834 : return __pyx_r;
9172 : }
9173 :
9174 : /* "View.MemoryView":407
9175 : *
9176 : *
9177 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9178 : * if index is Ellipsis:
9179 : * return self
9180 : */
9181 :
9182 : /* Python wrapper */
9183 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
9184 2834 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
9185 2834 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9186 2834 : PyObject *__pyx_r = 0;
9187 : __Pyx_RefNannyDeclarations
9188 2834 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9189 2834 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9190 2834 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
9191 :
9192 : /* function exit code */
9193 2834 : __Pyx_RefNannyFinishContext();
9194 2834 : return __pyx_r;
9195 : }
9196 :
9197 2834 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
9198 2834 : PyObject *__pyx_v_have_slices = NULL;
9199 2834 : PyObject *__pyx_v_indices = NULL;
9200 2834 : char *__pyx_v_itemp;
9201 2834 : PyObject *__pyx_r = NULL;
9202 : __Pyx_RefNannyDeclarations
9203 2834 : int __pyx_t_1;
9204 2834 : PyObject *__pyx_t_2 = NULL;
9205 2834 : PyObject *__pyx_t_3 = NULL;
9206 2834 : PyObject *__pyx_t_4 = NULL;
9207 2834 : char *__pyx_t_5;
9208 2834 : int __pyx_lineno = 0;
9209 2834 : const char *__pyx_filename = NULL;
9210 2834 : int __pyx_clineno = 0;
9211 2834 : __Pyx_RefNannySetupContext("__getitem__", 1);
9212 :
9213 : /* "View.MemoryView":408
9214 : *
9215 : * def __getitem__(memoryview self, object index):
9216 : * if index is Ellipsis: # <<<<<<<<<<<<<<
9217 : * return self
9218 : *
9219 : */
9220 2834 : __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
9221 2834 : if (__pyx_t_1) {
9222 :
9223 : /* "View.MemoryView":409
9224 : * def __getitem__(memoryview self, object index):
9225 : * if index is Ellipsis:
9226 : * return self # <<<<<<<<<<<<<<
9227 : *
9228 : * have_slices, indices = _unellipsify(index, self.view.ndim)
9229 : */
9230 0 : __Pyx_XDECREF(__pyx_r);
9231 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
9232 0 : __pyx_r = ((PyObject *)__pyx_v_self);
9233 0 : goto __pyx_L0;
9234 :
9235 : /* "View.MemoryView":408
9236 : *
9237 : * def __getitem__(memoryview self, object index):
9238 : * if index is Ellipsis: # <<<<<<<<<<<<<<
9239 : * return self
9240 : *
9241 : */
9242 : }
9243 :
9244 : /* "View.MemoryView":411
9245 : * return self
9246 : *
9247 : * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9248 : *
9249 : * cdef char *itemp
9250 : */
9251 2834 : __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
9252 2834 : __Pyx_GOTREF(__pyx_t_2);
9253 2834 : if (likely(__pyx_t_2 != Py_None)) {
9254 2834 : PyObject* sequence = __pyx_t_2;
9255 2834 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9256 2834 : if (unlikely(size != 2)) {
9257 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9258 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9259 0 : __PYX_ERR(1, 411, __pyx_L1_error)
9260 : }
9261 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9262 2834 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9263 2834 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
9264 2834 : __Pyx_INCREF(__pyx_t_3);
9265 2834 : __Pyx_INCREF(__pyx_t_4);
9266 : #else
9267 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
9268 : __Pyx_GOTREF(__pyx_t_3);
9269 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
9270 : __Pyx_GOTREF(__pyx_t_4);
9271 : #endif
9272 2834 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9273 : } else {
9274 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
9275 : }
9276 2834 : __pyx_v_have_slices = __pyx_t_3;
9277 2834 : __pyx_t_3 = 0;
9278 2834 : __pyx_v_indices = __pyx_t_4;
9279 2834 : __pyx_t_4 = 0;
9280 :
9281 : /* "View.MemoryView":414
9282 : *
9283 : * cdef char *itemp
9284 : * if have_slices: # <<<<<<<<<<<<<<
9285 : * return memview_slice(self, indices)
9286 : * else:
9287 : */
9288 2834 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
9289 2834 : if (__pyx_t_1) {
9290 :
9291 : /* "View.MemoryView":415
9292 : * cdef char *itemp
9293 : * if have_slices:
9294 : * return memview_slice(self, indices) # <<<<<<<<<<<<<<
9295 : * else:
9296 : * itemp = self.get_item_pointer(indices)
9297 : */
9298 0 : __Pyx_XDECREF(__pyx_r);
9299 0 : __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
9300 0 : __Pyx_GOTREF(__pyx_t_2);
9301 0 : __pyx_r = __pyx_t_2;
9302 0 : __pyx_t_2 = 0;
9303 0 : goto __pyx_L0;
9304 :
9305 : /* "View.MemoryView":414
9306 : *
9307 : * cdef char *itemp
9308 : * if have_slices: # <<<<<<<<<<<<<<
9309 : * return memview_slice(self, indices)
9310 : * else:
9311 : */
9312 : }
9313 :
9314 : /* "View.MemoryView":417
9315 : * return memview_slice(self, indices)
9316 : * else:
9317 : * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
9318 : * return self.convert_item_to_object(itemp)
9319 : *
9320 : */
9321 2834 : /*else*/ {
9322 2834 : __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(1, 417, __pyx_L1_error)
9323 2142 : __pyx_v_itemp = __pyx_t_5;
9324 :
9325 : /* "View.MemoryView":418
9326 : * else:
9327 : * itemp = self.get_item_pointer(indices)
9328 : * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
9329 : *
9330 : * def __setitem__(memoryview self, object index, object value):
9331 : */
9332 2142 : __Pyx_XDECREF(__pyx_r);
9333 2142 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
9334 2142 : __Pyx_GOTREF(__pyx_t_2);
9335 2142 : __pyx_r = __pyx_t_2;
9336 2142 : __pyx_t_2 = 0;
9337 2142 : goto __pyx_L0;
9338 : }
9339 :
9340 : /* "View.MemoryView":407
9341 : *
9342 : *
9343 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
9344 : * if index is Ellipsis:
9345 : * return self
9346 : */
9347 :
9348 : /* function exit code */
9349 692 : __pyx_L1_error:;
9350 692 : __Pyx_XDECREF(__pyx_t_2);
9351 692 : __Pyx_XDECREF(__pyx_t_3);
9352 692 : __Pyx_XDECREF(__pyx_t_4);
9353 692 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9354 692 : __pyx_r = NULL;
9355 2834 : __pyx_L0:;
9356 2834 : __Pyx_XDECREF(__pyx_v_have_slices);
9357 2834 : __Pyx_XDECREF(__pyx_v_indices);
9358 2834 : __Pyx_XGIVEREF(__pyx_r);
9359 2834 : __Pyx_RefNannyFinishContext();
9360 2834 : return __pyx_r;
9361 : }
9362 :
9363 : /* "View.MemoryView":420
9364 : * return self.convert_item_to_object(itemp)
9365 : *
9366 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9367 : * if self.view.readonly:
9368 : * raise TypeError, "Cannot assign to read-only memoryview"
9369 : */
9370 :
9371 : /* Python wrapper */
9372 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
9373 0 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9374 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9375 0 : int __pyx_r;
9376 : __Pyx_RefNannyDeclarations
9377 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9378 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9379 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
9380 :
9381 : /* function exit code */
9382 0 : __Pyx_RefNannyFinishContext();
9383 0 : return __pyx_r;
9384 : }
9385 :
9386 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9387 0 : PyObject *__pyx_v_have_slices = NULL;
9388 0 : PyObject *__pyx_v_obj = NULL;
9389 0 : int __pyx_r;
9390 : __Pyx_RefNannyDeclarations
9391 0 : PyObject *__pyx_t_1 = NULL;
9392 0 : PyObject *__pyx_t_2 = NULL;
9393 0 : PyObject *__pyx_t_3 = NULL;
9394 0 : int __pyx_t_4;
9395 0 : int __pyx_lineno = 0;
9396 0 : const char *__pyx_filename = NULL;
9397 0 : int __pyx_clineno = 0;
9398 0 : __Pyx_RefNannySetupContext("__setitem__", 0);
9399 0 : __Pyx_INCREF(__pyx_v_index);
9400 :
9401 : /* "View.MemoryView":421
9402 : *
9403 : * def __setitem__(memoryview self, object index, object value):
9404 : * if self.view.readonly: # <<<<<<<<<<<<<<
9405 : * raise TypeError, "Cannot assign to read-only memoryview"
9406 : *
9407 : */
9408 0 : if (unlikely(__pyx_v_self->view.readonly)) {
9409 :
9410 : /* "View.MemoryView":422
9411 : * def __setitem__(memoryview self, object index, object value):
9412 : * if self.view.readonly:
9413 : * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
9414 : *
9415 : * have_slices, index = _unellipsify(index, self.view.ndim)
9416 : */
9417 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
9418 0 : __PYX_ERR(1, 422, __pyx_L1_error)
9419 :
9420 : /* "View.MemoryView":421
9421 : *
9422 : * def __setitem__(memoryview self, object index, object value):
9423 : * if self.view.readonly: # <<<<<<<<<<<<<<
9424 : * raise TypeError, "Cannot assign to read-only memoryview"
9425 : *
9426 : */
9427 : }
9428 :
9429 : /* "View.MemoryView":424
9430 : * raise TypeError, "Cannot assign to read-only memoryview"
9431 : *
9432 : * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
9433 : *
9434 : * if have_slices:
9435 : */
9436 0 : __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
9437 0 : __Pyx_GOTREF(__pyx_t_1);
9438 0 : if (likely(__pyx_t_1 != Py_None)) {
9439 0 : PyObject* sequence = __pyx_t_1;
9440 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9441 0 : if (unlikely(size != 2)) {
9442 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9443 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9444 0 : __PYX_ERR(1, 424, __pyx_L1_error)
9445 : }
9446 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9447 0 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
9448 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
9449 0 : __Pyx_INCREF(__pyx_t_2);
9450 0 : __Pyx_INCREF(__pyx_t_3);
9451 : #else
9452 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
9453 : __Pyx_GOTREF(__pyx_t_2);
9454 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
9455 : __Pyx_GOTREF(__pyx_t_3);
9456 : #endif
9457 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9458 : } else {
9459 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
9460 : }
9461 0 : __pyx_v_have_slices = __pyx_t_2;
9462 0 : __pyx_t_2 = 0;
9463 0 : __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
9464 0 : __pyx_t_3 = 0;
9465 :
9466 : /* "View.MemoryView":426
9467 : * have_slices, index = _unellipsify(index, self.view.ndim)
9468 : *
9469 : * if have_slices: # <<<<<<<<<<<<<<
9470 : * obj = self.is_slice(value)
9471 : * if obj is not None:
9472 : */
9473 0 : __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
9474 0 : if (__pyx_t_4) {
9475 :
9476 : /* "View.MemoryView":427
9477 : *
9478 : * if have_slices:
9479 : * obj = self.is_slice(value) # <<<<<<<<<<<<<<
9480 : * if obj is not None:
9481 : * self.setitem_slice_assignment(self[index], obj)
9482 : */
9483 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
9484 0 : __Pyx_GOTREF(__pyx_t_1);
9485 0 : __pyx_v_obj = __pyx_t_1;
9486 0 : __pyx_t_1 = 0;
9487 :
9488 : /* "View.MemoryView":428
9489 : * if have_slices:
9490 : * obj = self.is_slice(value)
9491 : * if obj is not None: # <<<<<<<<<<<<<<
9492 : * self.setitem_slice_assignment(self[index], obj)
9493 : * else:
9494 : */
9495 0 : __pyx_t_4 = (__pyx_v_obj != Py_None);
9496 0 : if (__pyx_t_4) {
9497 :
9498 : /* "View.MemoryView":429
9499 : * obj = self.is_slice(value)
9500 : * if obj is not None:
9501 : * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
9502 : * else:
9503 : * self.setitem_slice_assign_scalar(self[index], value)
9504 : */
9505 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
9506 0 : __Pyx_GOTREF(__pyx_t_1);
9507 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
9508 0 : __Pyx_GOTREF(__pyx_t_3);
9509 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9510 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9511 :
9512 : /* "View.MemoryView":428
9513 : * if have_slices:
9514 : * obj = self.is_slice(value)
9515 : * if obj is not None: # <<<<<<<<<<<<<<
9516 : * self.setitem_slice_assignment(self[index], obj)
9517 : * else:
9518 : */
9519 0 : goto __pyx_L5;
9520 : }
9521 :
9522 : /* "View.MemoryView":431
9523 : * self.setitem_slice_assignment(self[index], obj)
9524 : * else:
9525 : * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
9526 : * else:
9527 : * self.setitem_indexed(index, value)
9528 : */
9529 0 : /*else*/ {
9530 0 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
9531 0 : __Pyx_GOTREF(__pyx_t_3);
9532 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
9533 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
9534 0 : __Pyx_GOTREF(__pyx_t_1);
9535 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9536 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9537 : }
9538 0 : __pyx_L5:;
9539 :
9540 : /* "View.MemoryView":426
9541 : * have_slices, index = _unellipsify(index, self.view.ndim)
9542 : *
9543 : * if have_slices: # <<<<<<<<<<<<<<
9544 : * obj = self.is_slice(value)
9545 : * if obj is not None:
9546 : */
9547 0 : goto __pyx_L4;
9548 : }
9549 :
9550 : /* "View.MemoryView":433
9551 : * self.setitem_slice_assign_scalar(self[index], value)
9552 : * else:
9553 : * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
9554 : *
9555 : * cdef is_slice(self, obj):
9556 : */
9557 0 : /*else*/ {
9558 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
9559 0 : __Pyx_GOTREF(__pyx_t_1);
9560 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9561 : }
9562 0 : __pyx_L4:;
9563 :
9564 : /* "View.MemoryView":420
9565 : * return self.convert_item_to_object(itemp)
9566 : *
9567 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
9568 : * if self.view.readonly:
9569 : * raise TypeError, "Cannot assign to read-only memoryview"
9570 : */
9571 :
9572 : /* function exit code */
9573 0 : __pyx_r = 0;
9574 0 : goto __pyx_L0;
9575 0 : __pyx_L1_error:;
9576 0 : __Pyx_XDECREF(__pyx_t_1);
9577 0 : __Pyx_XDECREF(__pyx_t_2);
9578 0 : __Pyx_XDECREF(__pyx_t_3);
9579 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9580 0 : __pyx_r = -1;
9581 0 : __pyx_L0:;
9582 0 : __Pyx_XDECREF(__pyx_v_have_slices);
9583 0 : __Pyx_XDECREF(__pyx_v_obj);
9584 0 : __Pyx_XDECREF(__pyx_v_index);
9585 0 : __Pyx_RefNannyFinishContext();
9586 0 : return __pyx_r;
9587 : }
9588 :
9589 : /* "View.MemoryView":435
9590 : * self.setitem_indexed(index, value)
9591 : *
9592 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9593 : * if not isinstance(obj, memoryview):
9594 : * try:
9595 : */
9596 :
9597 0 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
9598 0 : PyObject *__pyx_r = NULL;
9599 : __Pyx_RefNannyDeclarations
9600 0 : int __pyx_t_1;
9601 0 : int __pyx_t_2;
9602 0 : PyObject *__pyx_t_3 = NULL;
9603 0 : PyObject *__pyx_t_4 = NULL;
9604 0 : PyObject *__pyx_t_5 = NULL;
9605 0 : PyObject *__pyx_t_6 = NULL;
9606 0 : PyObject *__pyx_t_7 = NULL;
9607 0 : PyObject *__pyx_t_8 = NULL;
9608 0 : int __pyx_t_9;
9609 0 : int __pyx_lineno = 0;
9610 0 : const char *__pyx_filename = NULL;
9611 0 : int __pyx_clineno = 0;
9612 0 : __Pyx_RefNannySetupContext("is_slice", 0);
9613 0 : __Pyx_INCREF(__pyx_v_obj);
9614 :
9615 : /* "View.MemoryView":436
9616 : *
9617 : * cdef is_slice(self, obj):
9618 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9619 : * try:
9620 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9621 : */
9622 0 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
9623 0 : __pyx_t_2 = (!__pyx_t_1);
9624 0 : if (__pyx_t_2) {
9625 :
9626 : /* "View.MemoryView":437
9627 : * cdef is_slice(self, obj):
9628 : * if not isinstance(obj, memoryview):
9629 : * try: # <<<<<<<<<<<<<<
9630 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9631 : * self.dtype_is_object)
9632 : */
9633 0 : {
9634 0 : __Pyx_PyThreadState_declare
9635 0 : __Pyx_PyThreadState_assign
9636 0 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
9637 0 : __Pyx_XGOTREF(__pyx_t_3);
9638 0 : __Pyx_XGOTREF(__pyx_t_4);
9639 0 : __Pyx_XGOTREF(__pyx_t_5);
9640 0 : /*try:*/ {
9641 :
9642 : /* "View.MemoryView":438
9643 : * if not isinstance(obj, memoryview):
9644 : * try:
9645 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9646 : * self.dtype_is_object)
9647 : * except TypeError:
9648 : */
9649 0 : __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
9650 0 : __Pyx_GOTREF(__pyx_t_6);
9651 :
9652 : /* "View.MemoryView":439
9653 : * try:
9654 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9655 : * self.dtype_is_object) # <<<<<<<<<<<<<<
9656 : * except TypeError:
9657 : * return None
9658 : */
9659 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L4_error)
9660 0 : __Pyx_GOTREF(__pyx_t_7);
9661 :
9662 : /* "View.MemoryView":438
9663 : * if not isinstance(obj, memoryview):
9664 : * try:
9665 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
9666 : * self.dtype_is_object)
9667 : * except TypeError:
9668 : */
9669 0 : __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 438, __pyx_L4_error)
9670 0 : __Pyx_GOTREF(__pyx_t_8);
9671 0 : __Pyx_INCREF(__pyx_v_obj);
9672 0 : __Pyx_GIVEREF(__pyx_v_obj);
9673 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(1, 438, __pyx_L4_error);
9674 0 : __Pyx_GIVEREF(__pyx_t_6);
9675 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error);
9676 0 : __Pyx_GIVEREF(__pyx_t_7);
9677 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error);
9678 0 : __pyx_t_6 = 0;
9679 0 : __pyx_t_7 = 0;
9680 0 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error)
9681 0 : __Pyx_GOTREF(__pyx_t_7);
9682 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9683 0 : __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
9684 0 : __pyx_t_7 = 0;
9685 :
9686 : /* "View.MemoryView":437
9687 : * cdef is_slice(self, obj):
9688 : * if not isinstance(obj, memoryview):
9689 : * try: # <<<<<<<<<<<<<<
9690 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9691 : * self.dtype_is_object)
9692 : */
9693 : }
9694 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9695 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9696 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9697 0 : goto __pyx_L9_try_end;
9698 0 : __pyx_L4_error:;
9699 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9700 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9701 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9702 :
9703 : /* "View.MemoryView":440
9704 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9705 : * self.dtype_is_object)
9706 : * except TypeError: # <<<<<<<<<<<<<<
9707 : * return None
9708 : *
9709 : */
9710 0 : __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
9711 0 : if (__pyx_t_9) {
9712 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9713 0 : if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 440, __pyx_L6_except_error)
9714 0 : __Pyx_XGOTREF(__pyx_t_7);
9715 0 : __Pyx_XGOTREF(__pyx_t_8);
9716 0 : __Pyx_XGOTREF(__pyx_t_6);
9717 :
9718 : /* "View.MemoryView":441
9719 : * self.dtype_is_object)
9720 : * except TypeError:
9721 : * return None # <<<<<<<<<<<<<<
9722 : *
9723 : * return obj
9724 : */
9725 0 : __Pyx_XDECREF(__pyx_r);
9726 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9727 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9728 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9729 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9730 0 : goto __pyx_L7_except_return;
9731 : }
9732 0 : goto __pyx_L6_except_error;
9733 :
9734 : /* "View.MemoryView":437
9735 : * cdef is_slice(self, obj):
9736 : * if not isinstance(obj, memoryview):
9737 : * try: # <<<<<<<<<<<<<<
9738 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9739 : * self.dtype_is_object)
9740 : */
9741 0 : __pyx_L6_except_error:;
9742 0 : __Pyx_XGIVEREF(__pyx_t_3);
9743 0 : __Pyx_XGIVEREF(__pyx_t_4);
9744 0 : __Pyx_XGIVEREF(__pyx_t_5);
9745 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9746 0 : goto __pyx_L1_error;
9747 0 : __pyx_L7_except_return:;
9748 0 : __Pyx_XGIVEREF(__pyx_t_3);
9749 0 : __Pyx_XGIVEREF(__pyx_t_4);
9750 0 : __Pyx_XGIVEREF(__pyx_t_5);
9751 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
9752 0 : goto __pyx_L0;
9753 0 : __pyx_L9_try_end:;
9754 : }
9755 :
9756 : /* "View.MemoryView":436
9757 : *
9758 : * cdef is_slice(self, obj):
9759 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
9760 : * try:
9761 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
9762 : */
9763 : }
9764 :
9765 : /* "View.MemoryView":443
9766 : * return None
9767 : *
9768 : * return obj # <<<<<<<<<<<<<<
9769 : *
9770 : * cdef setitem_slice_assignment(self, dst, src):
9771 : */
9772 0 : __Pyx_XDECREF(__pyx_r);
9773 0 : __Pyx_INCREF(__pyx_v_obj);
9774 0 : __pyx_r = __pyx_v_obj;
9775 0 : goto __pyx_L0;
9776 :
9777 : /* "View.MemoryView":435
9778 : * self.setitem_indexed(index, value)
9779 : *
9780 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
9781 : * if not isinstance(obj, memoryview):
9782 : * try:
9783 : */
9784 :
9785 : /* function exit code */
9786 0 : __pyx_L1_error:;
9787 0 : __Pyx_XDECREF(__pyx_t_6);
9788 0 : __Pyx_XDECREF(__pyx_t_7);
9789 0 : __Pyx_XDECREF(__pyx_t_8);
9790 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
9791 : __pyx_r = 0;
9792 0 : __pyx_L0:;
9793 0 : __Pyx_XDECREF(__pyx_v_obj);
9794 0 : __Pyx_XGIVEREF(__pyx_r);
9795 0 : __Pyx_RefNannyFinishContext();
9796 0 : return __pyx_r;
9797 : }
9798 :
9799 : /* "View.MemoryView":445
9800 : * return obj
9801 : *
9802 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9803 : * cdef __Pyx_memviewslice dst_slice
9804 : * cdef __Pyx_memviewslice src_slice
9805 : */
9806 :
9807 0 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
9808 0 : __Pyx_memviewslice __pyx_v_dst_slice;
9809 0 : __Pyx_memviewslice __pyx_v_src_slice;
9810 0 : __Pyx_memviewslice __pyx_v_msrc;
9811 0 : __Pyx_memviewslice __pyx_v_mdst;
9812 0 : PyObject *__pyx_r = NULL;
9813 : __Pyx_RefNannyDeclarations
9814 0 : __Pyx_memviewslice *__pyx_t_1;
9815 0 : PyObject *__pyx_t_2 = NULL;
9816 0 : int __pyx_t_3;
9817 0 : int __pyx_t_4;
9818 0 : int __pyx_t_5;
9819 0 : int __pyx_lineno = 0;
9820 0 : const char *__pyx_filename = NULL;
9821 0 : int __pyx_clineno = 0;
9822 0 : __Pyx_RefNannySetupContext("setitem_slice_assignment", 1);
9823 :
9824 : /* "View.MemoryView":448
9825 : * cdef __Pyx_memviewslice dst_slice
9826 : * cdef __Pyx_memviewslice src_slice
9827 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
9828 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9829 : *
9830 : */
9831 0 : if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
9832 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
9833 0 : __pyx_v_msrc = (__pyx_t_1[0]);
9834 :
9835 : /* "View.MemoryView":449
9836 : * cdef __Pyx_memviewslice src_slice
9837 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
9838 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
9839 : *
9840 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9841 : */
9842 0 : if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
9843 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 449, __pyx_L1_error)
9844 0 : __pyx_v_mdst = (__pyx_t_1[0]);
9845 :
9846 : /* "View.MemoryView":451
9847 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
9848 : *
9849 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
9850 : *
9851 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9852 : */
9853 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
9854 0 : __Pyx_GOTREF(__pyx_t_2);
9855 0 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
9856 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9857 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
9858 0 : __Pyx_GOTREF(__pyx_t_2);
9859 0 : __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
9860 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9861 0 : __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
9862 :
9863 : /* "View.MemoryView":445
9864 : * return obj
9865 : *
9866 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
9867 : * cdef __Pyx_memviewslice dst_slice
9868 : * cdef __Pyx_memviewslice src_slice
9869 : */
9870 :
9871 : /* function exit code */
9872 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9873 0 : goto __pyx_L0;
9874 0 : __pyx_L1_error:;
9875 0 : __Pyx_XDECREF(__pyx_t_2);
9876 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
9877 : __pyx_r = 0;
9878 0 : __pyx_L0:;
9879 0 : __Pyx_XGIVEREF(__pyx_r);
9880 0 : __Pyx_RefNannyFinishContext();
9881 0 : return __pyx_r;
9882 : }
9883 :
9884 : /* "View.MemoryView":453
9885 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9886 : *
9887 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9888 : * cdef int array[128]
9889 : * cdef void *tmp = NULL
9890 : */
9891 :
9892 0 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
9893 0 : int __pyx_v_array[0x80];
9894 0 : void *__pyx_v_tmp;
9895 0 : void *__pyx_v_item;
9896 0 : __Pyx_memviewslice *__pyx_v_dst_slice;
9897 0 : __Pyx_memviewslice __pyx_v_tmp_slice;
9898 0 : PyObject *__pyx_r = NULL;
9899 : __Pyx_RefNannyDeclarations
9900 0 : __Pyx_memviewslice *__pyx_t_1;
9901 0 : int __pyx_t_2;
9902 0 : PyObject *__pyx_t_3 = NULL;
9903 0 : int __pyx_t_4;
9904 0 : int __pyx_t_5;
9905 0 : char const *__pyx_t_6;
9906 0 : PyObject *__pyx_t_7 = NULL;
9907 0 : PyObject *__pyx_t_8 = NULL;
9908 0 : PyObject *__pyx_t_9 = NULL;
9909 0 : PyObject *__pyx_t_10 = NULL;
9910 0 : PyObject *__pyx_t_11 = NULL;
9911 0 : PyObject *__pyx_t_12 = NULL;
9912 0 : int __pyx_lineno = 0;
9913 0 : const char *__pyx_filename = NULL;
9914 0 : int __pyx_clineno = 0;
9915 0 : __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1);
9916 :
9917 : /* "View.MemoryView":455
9918 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
9919 : * cdef int array[128]
9920 : * cdef void *tmp = NULL # <<<<<<<<<<<<<<
9921 : * cdef void *item
9922 : *
9923 : */
9924 0 : __pyx_v_tmp = NULL;
9925 :
9926 : /* "View.MemoryView":460
9927 : * cdef __Pyx_memviewslice *dst_slice
9928 : * cdef __Pyx_memviewslice tmp_slice
9929 : * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9930 : *
9931 : * if <size_t>self.view.itemsize > sizeof(array):
9932 : */
9933 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 460, __pyx_L1_error)
9934 0 : __pyx_v_dst_slice = __pyx_t_1;
9935 :
9936 : /* "View.MemoryView":462
9937 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9938 : *
9939 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9940 : * tmp = PyMem_Malloc(self.view.itemsize)
9941 : * if tmp == NULL:
9942 : */
9943 0 : __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9944 0 : if (__pyx_t_2) {
9945 :
9946 : /* "View.MemoryView":463
9947 : *
9948 : * if <size_t>self.view.itemsize > sizeof(array):
9949 : * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
9950 : * if tmp == NULL:
9951 : * raise MemoryError
9952 : */
9953 0 : __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
9954 :
9955 : /* "View.MemoryView":464
9956 : * if <size_t>self.view.itemsize > sizeof(array):
9957 : * tmp = PyMem_Malloc(self.view.itemsize)
9958 : * if tmp == NULL: # <<<<<<<<<<<<<<
9959 : * raise MemoryError
9960 : * item = tmp
9961 : */
9962 0 : __pyx_t_2 = (__pyx_v_tmp == NULL);
9963 0 : if (unlikely(__pyx_t_2)) {
9964 :
9965 : /* "View.MemoryView":465
9966 : * tmp = PyMem_Malloc(self.view.itemsize)
9967 : * if tmp == NULL:
9968 : * raise MemoryError # <<<<<<<<<<<<<<
9969 : * item = tmp
9970 : * else:
9971 : */
9972 0 : PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
9973 :
9974 : /* "View.MemoryView":464
9975 : * if <size_t>self.view.itemsize > sizeof(array):
9976 : * tmp = PyMem_Malloc(self.view.itemsize)
9977 : * if tmp == NULL: # <<<<<<<<<<<<<<
9978 : * raise MemoryError
9979 : * item = tmp
9980 : */
9981 : }
9982 :
9983 : /* "View.MemoryView":466
9984 : * if tmp == NULL:
9985 : * raise MemoryError
9986 : * item = tmp # <<<<<<<<<<<<<<
9987 : * else:
9988 : * item = <void *> array
9989 : */
9990 0 : __pyx_v_item = __pyx_v_tmp;
9991 :
9992 : /* "View.MemoryView":462
9993 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9994 : *
9995 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9996 : * tmp = PyMem_Malloc(self.view.itemsize)
9997 : * if tmp == NULL:
9998 : */
9999 0 : goto __pyx_L3;
10000 : }
10001 :
10002 : /* "View.MemoryView":468
10003 : * item = tmp
10004 : * else:
10005 : * item = <void *> array # <<<<<<<<<<<<<<
10006 : *
10007 : * try:
10008 : */
10009 : /*else*/ {
10010 : __pyx_v_item = ((void *)__pyx_v_array);
10011 : }
10012 0 : __pyx_L3:;
10013 :
10014 : /* "View.MemoryView":470
10015 : * item = <void *> array
10016 : *
10017 : * try: # <<<<<<<<<<<<<<
10018 : * if self.dtype_is_object:
10019 : * (<PyObject **> item)[0] = <PyObject *> value
10020 : */
10021 0 : /*try:*/ {
10022 :
10023 : /* "View.MemoryView":471
10024 : *
10025 : * try:
10026 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
10027 : * (<PyObject **> item)[0] = <PyObject *> value
10028 : * else:
10029 : */
10030 0 : if (__pyx_v_self->dtype_is_object) {
10031 :
10032 : /* "View.MemoryView":472
10033 : * try:
10034 : * if self.dtype_is_object:
10035 : * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
10036 : * else:
10037 : * self.assign_item_from_object(<char *> item, value)
10038 : */
10039 0 : (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
10040 :
10041 : /* "View.MemoryView":471
10042 : *
10043 : * try:
10044 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
10045 : * (<PyObject **> item)[0] = <PyObject *> value
10046 : * else:
10047 : */
10048 0 : goto __pyx_L8;
10049 : }
10050 :
10051 : /* "View.MemoryView":474
10052 : * (<PyObject **> item)[0] = <PyObject *> value
10053 : * else:
10054 : * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
10055 : *
10056 : *
10057 : */
10058 0 : /*else*/ {
10059 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
10060 0 : __Pyx_GOTREF(__pyx_t_3);
10061 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10062 : }
10063 0 : __pyx_L8:;
10064 :
10065 : /* "View.MemoryView":478
10066 : *
10067 : *
10068 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10069 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10070 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10071 : */
10072 0 : __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
10073 0 : if (__pyx_t_2) {
10074 :
10075 : /* "View.MemoryView":479
10076 : *
10077 : * if self.view.suboffsets != NULL:
10078 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
10079 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10080 : * item, self.dtype_is_object)
10081 : */
10082 0 : __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
10083 :
10084 : /* "View.MemoryView":478
10085 : *
10086 : *
10087 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
10088 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10089 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
10090 : */
10091 : }
10092 :
10093 : /* "View.MemoryView":480
10094 : * if self.view.suboffsets != NULL:
10095 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
10096 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
10097 : * item, self.dtype_is_object)
10098 : * finally:
10099 : */
10100 0 : __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
10101 : }
10102 :
10103 : /* "View.MemoryView":483
10104 : * item, self.dtype_is_object)
10105 : * finally:
10106 : * PyMem_Free(tmp) # <<<<<<<<<<<<<<
10107 : *
10108 : * cdef setitem_indexed(self, index, value):
10109 : */
10110 0 : /*finally:*/ {
10111 0 : /*normal exit:*/{
10112 0 : PyMem_Free(__pyx_v_tmp);
10113 0 : goto __pyx_L7;
10114 : }
10115 0 : __pyx_L6_error:;
10116 0 : /*exception exit:*/{
10117 0 : __Pyx_PyThreadState_declare
10118 0 : __Pyx_PyThreadState_assign
10119 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10120 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10121 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10122 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
10123 0 : __Pyx_XGOTREF(__pyx_t_7);
10124 0 : __Pyx_XGOTREF(__pyx_t_8);
10125 0 : __Pyx_XGOTREF(__pyx_t_9);
10126 0 : __Pyx_XGOTREF(__pyx_t_10);
10127 0 : __Pyx_XGOTREF(__pyx_t_11);
10128 0 : __Pyx_XGOTREF(__pyx_t_12);
10129 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
10130 0 : {
10131 0 : PyMem_Free(__pyx_v_tmp);
10132 : }
10133 0 : if (PY_MAJOR_VERSION >= 3) {
10134 0 : __Pyx_XGIVEREF(__pyx_t_10);
10135 0 : __Pyx_XGIVEREF(__pyx_t_11);
10136 0 : __Pyx_XGIVEREF(__pyx_t_12);
10137 0 : __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10138 : }
10139 0 : __Pyx_XGIVEREF(__pyx_t_7);
10140 0 : __Pyx_XGIVEREF(__pyx_t_8);
10141 0 : __Pyx_XGIVEREF(__pyx_t_9);
10142 0 : __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
10143 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
10144 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
10145 0 : goto __pyx_L1_error;
10146 : }
10147 0 : __pyx_L7:;
10148 : }
10149 :
10150 : /* "View.MemoryView":453
10151 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
10152 : *
10153 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10154 : * cdef int array[128]
10155 : * cdef void *tmp = NULL
10156 : */
10157 :
10158 : /* function exit code */
10159 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10160 0 : goto __pyx_L0;
10161 0 : __pyx_L1_error:;
10162 0 : __Pyx_XDECREF(__pyx_t_3);
10163 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
10164 : __pyx_r = 0;
10165 0 : __pyx_L0:;
10166 0 : __Pyx_XGIVEREF(__pyx_r);
10167 0 : __Pyx_RefNannyFinishContext();
10168 0 : return __pyx_r;
10169 : }
10170 :
10171 : /* "View.MemoryView":485
10172 : * PyMem_Free(tmp)
10173 : *
10174 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10175 : * cdef char *itemp = self.get_item_pointer(index)
10176 : * self.assign_item_from_object(itemp, value)
10177 : */
10178 :
10179 0 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10180 0 : char *__pyx_v_itemp;
10181 0 : PyObject *__pyx_r = NULL;
10182 : __Pyx_RefNannyDeclarations
10183 0 : char *__pyx_t_1;
10184 0 : PyObject *__pyx_t_2 = NULL;
10185 0 : int __pyx_lineno = 0;
10186 0 : const char *__pyx_filename = NULL;
10187 0 : int __pyx_clineno = 0;
10188 0 : __Pyx_RefNannySetupContext("setitem_indexed", 1);
10189 :
10190 : /* "View.MemoryView":486
10191 : *
10192 : * cdef setitem_indexed(self, index, value):
10193 : * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
10194 : * self.assign_item_from_object(itemp, value)
10195 : *
10196 : */
10197 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 486, __pyx_L1_error)
10198 0 : __pyx_v_itemp = __pyx_t_1;
10199 :
10200 : /* "View.MemoryView":487
10201 : * cdef setitem_indexed(self, index, value):
10202 : * cdef char *itemp = self.get_item_pointer(index)
10203 : * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
10204 : *
10205 : * cdef convert_item_to_object(self, char *itemp):
10206 : */
10207 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
10208 0 : __Pyx_GOTREF(__pyx_t_2);
10209 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10210 :
10211 : /* "View.MemoryView":485
10212 : * PyMem_Free(tmp)
10213 : *
10214 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
10215 : * cdef char *itemp = self.get_item_pointer(index)
10216 : * self.assign_item_from_object(itemp, value)
10217 : */
10218 :
10219 : /* function exit code */
10220 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10221 0 : goto __pyx_L0;
10222 0 : __pyx_L1_error:;
10223 0 : __Pyx_XDECREF(__pyx_t_2);
10224 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
10225 0 : __pyx_r = 0;
10226 0 : __pyx_L0:;
10227 0 : __Pyx_XGIVEREF(__pyx_r);
10228 0 : __Pyx_RefNannyFinishContext();
10229 0 : return __pyx_r;
10230 : }
10231 :
10232 : /* "View.MemoryView":489
10233 : * self.assign_item_from_object(itemp, value)
10234 : *
10235 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10236 : * """Only used if instantiated manually by the user, or if Cython doesn't
10237 : * know how to convert the type"""
10238 : */
10239 :
10240 0 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
10241 0 : PyObject *__pyx_v_struct = NULL;
10242 0 : PyObject *__pyx_v_bytesitem = 0;
10243 0 : PyObject *__pyx_v_result = NULL;
10244 0 : PyObject *__pyx_r = NULL;
10245 : __Pyx_RefNannyDeclarations
10246 0 : PyObject *__pyx_t_1 = NULL;
10247 0 : PyObject *__pyx_t_2 = NULL;
10248 0 : PyObject *__pyx_t_3 = NULL;
10249 0 : PyObject *__pyx_t_4 = NULL;
10250 0 : PyObject *__pyx_t_5 = NULL;
10251 0 : PyObject *__pyx_t_6 = NULL;
10252 0 : PyObject *__pyx_t_7 = NULL;
10253 0 : unsigned int __pyx_t_8;
10254 0 : Py_ssize_t __pyx_t_9;
10255 0 : int __pyx_t_10;
10256 0 : int __pyx_t_11;
10257 0 : int __pyx_lineno = 0;
10258 0 : const char *__pyx_filename = NULL;
10259 0 : int __pyx_clineno = 0;
10260 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
10261 :
10262 : /* "View.MemoryView":492
10263 : * """Only used if instantiated manually by the user, or if Cython doesn't
10264 : * know how to convert the type"""
10265 : * import struct # <<<<<<<<<<<<<<
10266 : * cdef bytes bytesitem
10267 : *
10268 : */
10269 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
10270 0 : __Pyx_GOTREF(__pyx_t_1);
10271 0 : __pyx_v_struct = __pyx_t_1;
10272 0 : __pyx_t_1 = 0;
10273 :
10274 : /* "View.MemoryView":495
10275 : * cdef bytes bytesitem
10276 : *
10277 : * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
10278 : * try:
10279 : * result = struct.unpack(self.view.format, bytesitem)
10280 : */
10281 0 : __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
10282 0 : __Pyx_GOTREF(__pyx_t_1);
10283 0 : __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
10284 0 : __pyx_t_1 = 0;
10285 :
10286 : /* "View.MemoryView":496
10287 : *
10288 : * bytesitem = itemp[:self.view.itemsize]
10289 : * try: # <<<<<<<<<<<<<<
10290 : * result = struct.unpack(self.view.format, bytesitem)
10291 : * except struct.error:
10292 : */
10293 0 : {
10294 0 : __Pyx_PyThreadState_declare
10295 0 : __Pyx_PyThreadState_assign
10296 0 : __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
10297 0 : __Pyx_XGOTREF(__pyx_t_2);
10298 0 : __Pyx_XGOTREF(__pyx_t_3);
10299 0 : __Pyx_XGOTREF(__pyx_t_4);
10300 0 : /*try:*/ {
10301 :
10302 : /* "View.MemoryView":497
10303 : * bytesitem = itemp[:self.view.itemsize]
10304 : * try:
10305 : * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
10306 : * except struct.error:
10307 : * raise ValueError, "Unable to convert item to object"
10308 : */
10309 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L3_error)
10310 0 : __Pyx_GOTREF(__pyx_t_5);
10311 0 : __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
10312 0 : __Pyx_GOTREF(__pyx_t_6);
10313 0 : __pyx_t_7 = NULL;
10314 0 : __pyx_t_8 = 0;
10315 : #if CYTHON_UNPACK_METHODS
10316 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
10317 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10318 0 : if (likely(__pyx_t_7)) {
10319 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10320 0 : __Pyx_INCREF(__pyx_t_7);
10321 0 : __Pyx_INCREF(function);
10322 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
10323 : __pyx_t_8 = 1;
10324 : }
10325 : }
10326 : #endif
10327 0 : {
10328 0 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
10329 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
10330 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10331 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10332 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
10333 0 : __Pyx_GOTREF(__pyx_t_1);
10334 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10335 : }
10336 0 : __pyx_v_result = __pyx_t_1;
10337 0 : __pyx_t_1 = 0;
10338 :
10339 : /* "View.MemoryView":496
10340 : *
10341 : * bytesitem = itemp[:self.view.itemsize]
10342 : * try: # <<<<<<<<<<<<<<
10343 : * result = struct.unpack(self.view.format, bytesitem)
10344 : * except struct.error:
10345 : */
10346 : }
10347 :
10348 : /* "View.MemoryView":501
10349 : * raise ValueError, "Unable to convert item to object"
10350 : * else:
10351 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10352 : * return result[0]
10353 : * return result
10354 : */
10355 0 : /*else:*/ {
10356 0 : __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
10357 0 : __pyx_t_10 = (__pyx_t_9 == 1);
10358 0 : if (__pyx_t_10) {
10359 :
10360 : /* "View.MemoryView":502
10361 : * else:
10362 : * if len(self.view.format) == 1:
10363 : * return result[0] # <<<<<<<<<<<<<<
10364 : * return result
10365 : *
10366 : */
10367 0 : __Pyx_XDECREF(__pyx_r);
10368 0 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
10369 0 : __Pyx_GOTREF(__pyx_t_1);
10370 0 : __pyx_r = __pyx_t_1;
10371 0 : __pyx_t_1 = 0;
10372 0 : goto __pyx_L6_except_return;
10373 :
10374 : /* "View.MemoryView":501
10375 : * raise ValueError, "Unable to convert item to object"
10376 : * else:
10377 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
10378 : * return result[0]
10379 : * return result
10380 : */
10381 : }
10382 :
10383 : /* "View.MemoryView":503
10384 : * if len(self.view.format) == 1:
10385 : * return result[0]
10386 : * return result # <<<<<<<<<<<<<<
10387 : *
10388 : * cdef assign_item_from_object(self, char *itemp, object value):
10389 : */
10390 0 : __Pyx_XDECREF(__pyx_r);
10391 0 : __Pyx_INCREF(__pyx_v_result);
10392 0 : __pyx_r = __pyx_v_result;
10393 0 : goto __pyx_L6_except_return;
10394 : }
10395 0 : __pyx_L3_error:;
10396 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
10397 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10398 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10399 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10400 :
10401 : /* "View.MemoryView":498
10402 : * try:
10403 : * result = struct.unpack(self.view.format, bytesitem)
10404 : * except struct.error: # <<<<<<<<<<<<<<
10405 : * raise ValueError, "Unable to convert item to object"
10406 : * else:
10407 : */
10408 0 : __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
10409 0 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error)
10410 0 : __Pyx_GOTREF(__pyx_t_7);
10411 0 : __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
10412 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10413 0 : __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
10414 0 : __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
10415 0 : if (__pyx_t_11) {
10416 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10417 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
10418 0 : __Pyx_XGOTREF(__pyx_t_6);
10419 0 : __Pyx_XGOTREF(__pyx_t_5);
10420 0 : __Pyx_XGOTREF(__pyx_t_1);
10421 :
10422 : /* "View.MemoryView":499
10423 : * result = struct.unpack(self.view.format, bytesitem)
10424 : * except struct.error:
10425 : * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
10426 : * else:
10427 : * if len(self.view.format) == 1:
10428 : */
10429 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
10430 0 : __PYX_ERR(1, 499, __pyx_L5_except_error)
10431 : }
10432 0 : goto __pyx_L5_except_error;
10433 :
10434 : /* "View.MemoryView":496
10435 : *
10436 : * bytesitem = itemp[:self.view.itemsize]
10437 : * try: # <<<<<<<<<<<<<<
10438 : * result = struct.unpack(self.view.format, bytesitem)
10439 : * except struct.error:
10440 : */
10441 0 : __pyx_L5_except_error:;
10442 0 : __Pyx_XGIVEREF(__pyx_t_2);
10443 0 : __Pyx_XGIVEREF(__pyx_t_3);
10444 0 : __Pyx_XGIVEREF(__pyx_t_4);
10445 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10446 0 : goto __pyx_L1_error;
10447 0 : __pyx_L6_except_return:;
10448 0 : __Pyx_XGIVEREF(__pyx_t_2);
10449 0 : __Pyx_XGIVEREF(__pyx_t_3);
10450 0 : __Pyx_XGIVEREF(__pyx_t_4);
10451 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
10452 0 : goto __pyx_L0;
10453 : }
10454 :
10455 : /* "View.MemoryView":489
10456 : * self.assign_item_from_object(itemp, value)
10457 : *
10458 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
10459 : * """Only used if instantiated manually by the user, or if Cython doesn't
10460 : * know how to convert the type"""
10461 : */
10462 :
10463 : /* function exit code */
10464 0 : __pyx_L1_error:;
10465 0 : __Pyx_XDECREF(__pyx_t_1);
10466 0 : __Pyx_XDECREF(__pyx_t_5);
10467 0 : __Pyx_XDECREF(__pyx_t_6);
10468 0 : __Pyx_XDECREF(__pyx_t_7);
10469 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10470 : __pyx_r = 0;
10471 0 : __pyx_L0:;
10472 0 : __Pyx_XDECREF(__pyx_v_struct);
10473 0 : __Pyx_XDECREF(__pyx_v_bytesitem);
10474 0 : __Pyx_XDECREF(__pyx_v_result);
10475 0 : __Pyx_XGIVEREF(__pyx_r);
10476 0 : __Pyx_RefNannyFinishContext();
10477 0 : return __pyx_r;
10478 : }
10479 :
10480 : /* "View.MemoryView":505
10481 : * return result
10482 : *
10483 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10484 : * """Only used if instantiated manually by the user, or if Cython doesn't
10485 : * know how to convert the type"""
10486 : */
10487 :
10488 0 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
10489 0 : PyObject *__pyx_v_struct = NULL;
10490 0 : char __pyx_v_c;
10491 0 : PyObject *__pyx_v_bytesvalue = 0;
10492 0 : Py_ssize_t __pyx_v_i;
10493 0 : PyObject *__pyx_r = NULL;
10494 : __Pyx_RefNannyDeclarations
10495 0 : PyObject *__pyx_t_1 = NULL;
10496 0 : int __pyx_t_2;
10497 0 : PyObject *__pyx_t_3 = NULL;
10498 0 : PyObject *__pyx_t_4 = NULL;
10499 0 : PyObject *__pyx_t_5 = NULL;
10500 0 : unsigned int __pyx_t_6;
10501 0 : Py_ssize_t __pyx_t_7;
10502 0 : PyObject *__pyx_t_8 = NULL;
10503 0 : char *__pyx_t_9;
10504 0 : char *__pyx_t_10;
10505 0 : char *__pyx_t_11;
10506 0 : char *__pyx_t_12;
10507 0 : int __pyx_lineno = 0;
10508 0 : const char *__pyx_filename = NULL;
10509 0 : int __pyx_clineno = 0;
10510 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
10511 :
10512 : /* "View.MemoryView":508
10513 : * """Only used if instantiated manually by the user, or if Cython doesn't
10514 : * know how to convert the type"""
10515 : * import struct # <<<<<<<<<<<<<<
10516 : * cdef char c
10517 : * cdef bytes bytesvalue
10518 : */
10519 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
10520 0 : __Pyx_GOTREF(__pyx_t_1);
10521 0 : __pyx_v_struct = __pyx_t_1;
10522 0 : __pyx_t_1 = 0;
10523 :
10524 : /* "View.MemoryView":513
10525 : * cdef Py_ssize_t i
10526 : *
10527 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10528 : * bytesvalue = struct.pack(self.view.format, *value)
10529 : * else:
10530 : */
10531 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_value);
10532 0 : if (__pyx_t_2) {
10533 :
10534 : /* "View.MemoryView":514
10535 : *
10536 : * if isinstance(value, tuple):
10537 : * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
10538 : * else:
10539 : * bytesvalue = struct.pack(self.view.format, value)
10540 : */
10541 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
10542 0 : __Pyx_GOTREF(__pyx_t_1);
10543 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
10544 0 : __Pyx_GOTREF(__pyx_t_3);
10545 0 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
10546 0 : __Pyx_GOTREF(__pyx_t_4);
10547 0 : __Pyx_GIVEREF(__pyx_t_3);
10548 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error);
10549 0 : __pyx_t_3 = 0;
10550 0 : __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
10551 0 : __Pyx_GOTREF(__pyx_t_3);
10552 0 : __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
10553 0 : __Pyx_GOTREF(__pyx_t_5);
10554 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10555 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10556 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
10557 0 : __Pyx_GOTREF(__pyx_t_3);
10558 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10559 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10560 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
10561 0 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
10562 0 : __pyx_t_3 = 0;
10563 :
10564 : /* "View.MemoryView":513
10565 : * cdef Py_ssize_t i
10566 : *
10567 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
10568 : * bytesvalue = struct.pack(self.view.format, *value)
10569 : * else:
10570 : */
10571 0 : goto __pyx_L3;
10572 : }
10573 :
10574 : /* "View.MemoryView":516
10575 : * bytesvalue = struct.pack(self.view.format, *value)
10576 : * else:
10577 : * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
10578 : *
10579 : * for i, c in enumerate(bytesvalue):
10580 : */
10581 0 : /*else*/ {
10582 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
10583 0 : __Pyx_GOTREF(__pyx_t_5);
10584 0 : __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
10585 0 : __Pyx_GOTREF(__pyx_t_1);
10586 0 : __pyx_t_4 = NULL;
10587 0 : __pyx_t_6 = 0;
10588 : #if CYTHON_UNPACK_METHODS
10589 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
10590 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
10591 0 : if (likely(__pyx_t_4)) {
10592 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10593 0 : __Pyx_INCREF(__pyx_t_4);
10594 0 : __Pyx_INCREF(function);
10595 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
10596 : __pyx_t_6 = 1;
10597 : }
10598 : }
10599 : #endif
10600 0 : {
10601 0 : PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
10602 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
10603 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10604 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10605 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
10606 0 : __Pyx_GOTREF(__pyx_t_3);
10607 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10608 : }
10609 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
10610 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
10611 : __pyx_t_3 = 0;
10612 : }
10613 0 : __pyx_L3:;
10614 :
10615 : /* "View.MemoryView":518
10616 : * bytesvalue = struct.pack(self.view.format, value)
10617 : *
10618 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10619 : * itemp[i] = c
10620 : *
10621 : */
10622 0 : __pyx_t_7 = 0;
10623 0 : if (unlikely(__pyx_v_bytesvalue == Py_None)) {
10624 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
10625 0 : __PYX_ERR(1, 518, __pyx_L1_error)
10626 : }
10627 0 : __Pyx_INCREF(__pyx_v_bytesvalue);
10628 0 : __pyx_t_8 = __pyx_v_bytesvalue;
10629 0 : __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
10630 0 : __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
10631 0 : for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
10632 0 : __pyx_t_9 = __pyx_t_12;
10633 0 : __pyx_v_c = (__pyx_t_9[0]);
10634 :
10635 : /* "View.MemoryView":519
10636 : *
10637 : * for i, c in enumerate(bytesvalue):
10638 : * itemp[i] = c # <<<<<<<<<<<<<<
10639 : *
10640 : * @cname('getbuffer')
10641 : */
10642 0 : __pyx_v_i = __pyx_t_7;
10643 :
10644 : /* "View.MemoryView":518
10645 : * bytesvalue = struct.pack(self.view.format, value)
10646 : *
10647 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
10648 : * itemp[i] = c
10649 : *
10650 : */
10651 0 : __pyx_t_7 = (__pyx_t_7 + 1);
10652 :
10653 : /* "View.MemoryView":519
10654 : *
10655 : * for i, c in enumerate(bytesvalue):
10656 : * itemp[i] = c # <<<<<<<<<<<<<<
10657 : *
10658 : * @cname('getbuffer')
10659 : */
10660 0 : (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
10661 : }
10662 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10663 :
10664 : /* "View.MemoryView":505
10665 : * return result
10666 : *
10667 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
10668 : * """Only used if instantiated manually by the user, or if Cython doesn't
10669 : * know how to convert the type"""
10670 : */
10671 :
10672 : /* function exit code */
10673 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10674 0 : goto __pyx_L0;
10675 0 : __pyx_L1_error:;
10676 0 : __Pyx_XDECREF(__pyx_t_1);
10677 0 : __Pyx_XDECREF(__pyx_t_3);
10678 0 : __Pyx_XDECREF(__pyx_t_4);
10679 0 : __Pyx_XDECREF(__pyx_t_5);
10680 0 : __Pyx_XDECREF(__pyx_t_8);
10681 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
10682 0 : __pyx_r = 0;
10683 0 : __pyx_L0:;
10684 0 : __Pyx_XDECREF(__pyx_v_struct);
10685 0 : __Pyx_XDECREF(__pyx_v_bytesvalue);
10686 0 : __Pyx_XGIVEREF(__pyx_r);
10687 0 : __Pyx_RefNannyFinishContext();
10688 0 : return __pyx_r;
10689 : }
10690 :
10691 : /* "View.MemoryView":521
10692 : * itemp[i] = c
10693 : *
10694 : * @cname('getbuffer') # <<<<<<<<<<<<<<
10695 : * def __getbuffer__(self, Py_buffer *info, int flags):
10696 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10697 : */
10698 :
10699 : /* Python wrapper */
10700 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
10701 1792 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10702 1792 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10703 1792 : int __pyx_r;
10704 : __Pyx_RefNannyDeclarations
10705 1792 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
10706 1792 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10707 1792 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
10708 :
10709 : /* function exit code */
10710 1792 : __Pyx_RefNannyFinishContext();
10711 1792 : return __pyx_r;
10712 : }
10713 :
10714 1792 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
10715 1792 : int __pyx_r;
10716 : __Pyx_RefNannyDeclarations
10717 1792 : int __pyx_t_1;
10718 1792 : int __pyx_t_2;
10719 1792 : Py_ssize_t *__pyx_t_3;
10720 1792 : char *__pyx_t_4;
10721 1792 : void *__pyx_t_5;
10722 1792 : int __pyx_t_6;
10723 1792 : Py_ssize_t __pyx_t_7;
10724 1792 : int __pyx_lineno = 0;
10725 1792 : const char *__pyx_filename = NULL;
10726 1792 : int __pyx_clineno = 0;
10727 1792 : if (unlikely(__pyx_v_info == NULL)) {
10728 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
10729 0 : return -1;
10730 : }
10731 1792 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
10732 1792 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
10733 1792 : __Pyx_GIVEREF(__pyx_v_info->obj);
10734 :
10735 : /* "View.MemoryView":523
10736 : * @cname('getbuffer')
10737 : * def __getbuffer__(self, Py_buffer *info, int flags):
10738 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
10739 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10740 : *
10741 : */
10742 1792 : __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
10743 1792 : if (__pyx_t_2) {
10744 : } else {
10745 1792 : __pyx_t_1 = __pyx_t_2;
10746 1792 : goto __pyx_L4_bool_binop_done;
10747 : }
10748 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
10749 1792 : __pyx_L4_bool_binop_done:;
10750 1792 : if (unlikely(__pyx_t_1)) {
10751 :
10752 : /* "View.MemoryView":524
10753 : * def __getbuffer__(self, Py_buffer *info, int flags):
10754 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10755 : * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
10756 : *
10757 : * if flags & PyBUF_ND:
10758 : */
10759 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
10760 0 : __PYX_ERR(1, 524, __pyx_L1_error)
10761 :
10762 : /* "View.MemoryView":523
10763 : * @cname('getbuffer')
10764 : * def __getbuffer__(self, Py_buffer *info, int flags):
10765 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
10766 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10767 : *
10768 : */
10769 : }
10770 :
10771 : /* "View.MemoryView":526
10772 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10773 : *
10774 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10775 : * info.shape = self.view.shape
10776 : * else:
10777 : */
10778 1792 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
10779 1792 : if (__pyx_t_1) {
10780 :
10781 : /* "View.MemoryView":527
10782 : *
10783 : * if flags & PyBUF_ND:
10784 : * info.shape = self.view.shape # <<<<<<<<<<<<<<
10785 : * else:
10786 : * info.shape = NULL
10787 : */
10788 1792 : __pyx_t_3 = __pyx_v_self->view.shape;
10789 1792 : __pyx_v_info->shape = __pyx_t_3;
10790 :
10791 : /* "View.MemoryView":526
10792 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
10793 : *
10794 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
10795 : * info.shape = self.view.shape
10796 : * else:
10797 : */
10798 1792 : goto __pyx_L6;
10799 : }
10800 :
10801 : /* "View.MemoryView":529
10802 : * info.shape = self.view.shape
10803 : * else:
10804 : * info.shape = NULL # <<<<<<<<<<<<<<
10805 : *
10806 : * if flags & PyBUF_STRIDES:
10807 : */
10808 0 : /*else*/ {
10809 0 : __pyx_v_info->shape = NULL;
10810 : }
10811 1792 : __pyx_L6:;
10812 :
10813 : /* "View.MemoryView":531
10814 : * info.shape = NULL
10815 : *
10816 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10817 : * info.strides = self.view.strides
10818 : * else:
10819 : */
10820 1792 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
10821 1792 : if (__pyx_t_1) {
10822 :
10823 : /* "View.MemoryView":532
10824 : *
10825 : * if flags & PyBUF_STRIDES:
10826 : * info.strides = self.view.strides # <<<<<<<<<<<<<<
10827 : * else:
10828 : * info.strides = NULL
10829 : */
10830 1792 : __pyx_t_3 = __pyx_v_self->view.strides;
10831 1792 : __pyx_v_info->strides = __pyx_t_3;
10832 :
10833 : /* "View.MemoryView":531
10834 : * info.shape = NULL
10835 : *
10836 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
10837 : * info.strides = self.view.strides
10838 : * else:
10839 : */
10840 1792 : goto __pyx_L7;
10841 : }
10842 :
10843 : /* "View.MemoryView":534
10844 : * info.strides = self.view.strides
10845 : * else:
10846 : * info.strides = NULL # <<<<<<<<<<<<<<
10847 : *
10848 : * if flags & PyBUF_INDIRECT:
10849 : */
10850 0 : /*else*/ {
10851 0 : __pyx_v_info->strides = NULL;
10852 : }
10853 1792 : __pyx_L7:;
10854 :
10855 : /* "View.MemoryView":536
10856 : * info.strides = NULL
10857 : *
10858 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10859 : * info.suboffsets = self.view.suboffsets
10860 : * else:
10861 : */
10862 1792 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
10863 1792 : if (__pyx_t_1) {
10864 :
10865 : /* "View.MemoryView":537
10866 : *
10867 : * if flags & PyBUF_INDIRECT:
10868 : * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
10869 : * else:
10870 : * info.suboffsets = NULL
10871 : */
10872 1792 : __pyx_t_3 = __pyx_v_self->view.suboffsets;
10873 1792 : __pyx_v_info->suboffsets = __pyx_t_3;
10874 :
10875 : /* "View.MemoryView":536
10876 : * info.strides = NULL
10877 : *
10878 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
10879 : * info.suboffsets = self.view.suboffsets
10880 : * else:
10881 : */
10882 1792 : goto __pyx_L8;
10883 : }
10884 :
10885 : /* "View.MemoryView":539
10886 : * info.suboffsets = self.view.suboffsets
10887 : * else:
10888 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
10889 : *
10890 : * if flags & PyBUF_FORMAT:
10891 : */
10892 0 : /*else*/ {
10893 0 : __pyx_v_info->suboffsets = NULL;
10894 : }
10895 1792 : __pyx_L8:;
10896 :
10897 : /* "View.MemoryView":541
10898 : * info.suboffsets = NULL
10899 : *
10900 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10901 : * info.format = self.view.format
10902 : * else:
10903 : */
10904 1792 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10905 1792 : if (__pyx_t_1) {
10906 :
10907 : /* "View.MemoryView":542
10908 : *
10909 : * if flags & PyBUF_FORMAT:
10910 : * info.format = self.view.format # <<<<<<<<<<<<<<
10911 : * else:
10912 : * info.format = NULL
10913 : */
10914 1792 : __pyx_t_4 = __pyx_v_self->view.format;
10915 1792 : __pyx_v_info->format = __pyx_t_4;
10916 :
10917 : /* "View.MemoryView":541
10918 : * info.suboffsets = NULL
10919 : *
10920 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10921 : * info.format = self.view.format
10922 : * else:
10923 : */
10924 1792 : goto __pyx_L9;
10925 : }
10926 :
10927 : /* "View.MemoryView":544
10928 : * info.format = self.view.format
10929 : * else:
10930 : * info.format = NULL # <<<<<<<<<<<<<<
10931 : *
10932 : * info.buf = self.view.buf
10933 : */
10934 0 : /*else*/ {
10935 0 : __pyx_v_info->format = NULL;
10936 : }
10937 1792 : __pyx_L9:;
10938 :
10939 : /* "View.MemoryView":546
10940 : * info.format = NULL
10941 : *
10942 : * info.buf = self.view.buf # <<<<<<<<<<<<<<
10943 : * info.ndim = self.view.ndim
10944 : * info.itemsize = self.view.itemsize
10945 : */
10946 1792 : __pyx_t_5 = __pyx_v_self->view.buf;
10947 1792 : __pyx_v_info->buf = __pyx_t_5;
10948 :
10949 : /* "View.MemoryView":547
10950 : *
10951 : * info.buf = self.view.buf
10952 : * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10953 : * info.itemsize = self.view.itemsize
10954 : * info.len = self.view.len
10955 : */
10956 1792 : __pyx_t_6 = __pyx_v_self->view.ndim;
10957 1792 : __pyx_v_info->ndim = __pyx_t_6;
10958 :
10959 : /* "View.MemoryView":548
10960 : * info.buf = self.view.buf
10961 : * info.ndim = self.view.ndim
10962 : * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10963 : * info.len = self.view.len
10964 : * info.readonly = self.view.readonly
10965 : */
10966 1792 : __pyx_t_7 = __pyx_v_self->view.itemsize;
10967 1792 : __pyx_v_info->itemsize = __pyx_t_7;
10968 :
10969 : /* "View.MemoryView":549
10970 : * info.ndim = self.view.ndim
10971 : * info.itemsize = self.view.itemsize
10972 : * info.len = self.view.len # <<<<<<<<<<<<<<
10973 : * info.readonly = self.view.readonly
10974 : * info.obj = self
10975 : */
10976 1792 : __pyx_t_7 = __pyx_v_self->view.len;
10977 1792 : __pyx_v_info->len = __pyx_t_7;
10978 :
10979 : /* "View.MemoryView":550
10980 : * info.itemsize = self.view.itemsize
10981 : * info.len = self.view.len
10982 : * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10983 : * info.obj = self
10984 : *
10985 : */
10986 1792 : __pyx_t_1 = __pyx_v_self->view.readonly;
10987 1792 : __pyx_v_info->readonly = __pyx_t_1;
10988 :
10989 : /* "View.MemoryView":551
10990 : * info.len = self.view.len
10991 : * info.readonly = self.view.readonly
10992 : * info.obj = self # <<<<<<<<<<<<<<
10993 : *
10994 : *
10995 : */
10996 1792 : __Pyx_INCREF((PyObject *)__pyx_v_self);
10997 1792 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10998 1792 : __Pyx_GOTREF(__pyx_v_info->obj);
10999 1792 : __Pyx_DECREF(__pyx_v_info->obj);
11000 1792 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
11001 :
11002 : /* "View.MemoryView":521
11003 : * itemp[i] = c
11004 : *
11005 : * @cname('getbuffer') # <<<<<<<<<<<<<<
11006 : * def __getbuffer__(self, Py_buffer *info, int flags):
11007 : * if flags & PyBUF_WRITABLE and self.view.readonly:
11008 : */
11009 :
11010 : /* function exit code */
11011 1792 : __pyx_r = 0;
11012 1792 : goto __pyx_L0;
11013 0 : __pyx_L1_error:;
11014 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11015 0 : __pyx_r = -1;
11016 0 : if (__pyx_v_info->obj != NULL) {
11017 0 : __Pyx_GOTREF(__pyx_v_info->obj);
11018 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11019 : }
11020 0 : goto __pyx_L2;
11021 1792 : __pyx_L0:;
11022 1792 : if (__pyx_v_info->obj == Py_None) {
11023 0 : __Pyx_GOTREF(__pyx_v_info->obj);
11024 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
11025 : }
11026 1792 : __pyx_L2:;
11027 : __Pyx_RefNannyFinishContext();
11028 : return __pyx_r;
11029 : }
11030 :
11031 : /* "View.MemoryView":554
11032 : *
11033 : *
11034 : * @property # <<<<<<<<<<<<<<
11035 : * def T(self):
11036 : * cdef _memoryviewslice result = memoryview_copy(self)
11037 : */
11038 :
11039 : /* Python wrapper */
11040 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
11041 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
11042 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11043 0 : PyObject *__pyx_r = 0;
11044 : __Pyx_RefNannyDeclarations
11045 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11046 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11047 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11048 :
11049 : /* function exit code */
11050 0 : __Pyx_RefNannyFinishContext();
11051 0 : return __pyx_r;
11052 : }
11053 :
11054 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11055 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
11056 0 : PyObject *__pyx_r = NULL;
11057 : __Pyx_RefNannyDeclarations
11058 0 : PyObject *__pyx_t_1 = NULL;
11059 0 : int __pyx_t_2;
11060 0 : int __pyx_lineno = 0;
11061 0 : const char *__pyx_filename = NULL;
11062 0 : int __pyx_clineno = 0;
11063 0 : __Pyx_RefNannySetupContext("__get__", 1);
11064 :
11065 : /* "View.MemoryView":556
11066 : * @property
11067 : * def T(self):
11068 : * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
11069 : * transpose_memslice(&result.from_slice)
11070 : * return result
11071 : */
11072 0 : __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
11073 0 : __Pyx_GOTREF(__pyx_t_1);
11074 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
11075 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
11076 0 : __pyx_t_1 = 0;
11077 :
11078 : /* "View.MemoryView":557
11079 : * def T(self):
11080 : * cdef _memoryviewslice result = memoryview_copy(self)
11081 : * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
11082 : * return result
11083 : *
11084 : */
11085 0 : __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
11086 :
11087 : /* "View.MemoryView":558
11088 : * cdef _memoryviewslice result = memoryview_copy(self)
11089 : * transpose_memslice(&result.from_slice)
11090 : * return result # <<<<<<<<<<<<<<
11091 : *
11092 : * @property
11093 : */
11094 0 : __Pyx_XDECREF(__pyx_r);
11095 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
11096 0 : __pyx_r = ((PyObject *)__pyx_v_result);
11097 0 : goto __pyx_L0;
11098 :
11099 : /* "View.MemoryView":554
11100 : *
11101 : *
11102 : * @property # <<<<<<<<<<<<<<
11103 : * def T(self):
11104 : * cdef _memoryviewslice result = memoryview_copy(self)
11105 : */
11106 :
11107 : /* function exit code */
11108 0 : __pyx_L1_error:;
11109 0 : __Pyx_XDECREF(__pyx_t_1);
11110 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11111 0 : __pyx_r = NULL;
11112 0 : __pyx_L0:;
11113 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
11114 0 : __Pyx_XGIVEREF(__pyx_r);
11115 0 : __Pyx_RefNannyFinishContext();
11116 0 : return __pyx_r;
11117 : }
11118 :
11119 : /* "View.MemoryView":560
11120 : * return result
11121 : *
11122 : * @property # <<<<<<<<<<<<<<
11123 : * def base(self):
11124 : * return self._get_base()
11125 : */
11126 :
11127 : /* Python wrapper */
11128 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
11129 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
11130 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11131 0 : PyObject *__pyx_r = 0;
11132 : __Pyx_RefNannyDeclarations
11133 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11134 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11135 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11136 :
11137 : /* function exit code */
11138 0 : __Pyx_RefNannyFinishContext();
11139 0 : return __pyx_r;
11140 : }
11141 :
11142 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11143 0 : PyObject *__pyx_r = NULL;
11144 : __Pyx_RefNannyDeclarations
11145 0 : PyObject *__pyx_t_1 = NULL;
11146 0 : int __pyx_lineno = 0;
11147 0 : const char *__pyx_filename = NULL;
11148 0 : int __pyx_clineno = 0;
11149 0 : __Pyx_RefNannySetupContext("__get__", 1);
11150 :
11151 : /* "View.MemoryView":562
11152 : * @property
11153 : * def base(self):
11154 : * return self._get_base() # <<<<<<<<<<<<<<
11155 : *
11156 : * cdef _get_base(self):
11157 : */
11158 0 : __Pyx_XDECREF(__pyx_r);
11159 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
11160 0 : __Pyx_GOTREF(__pyx_t_1);
11161 0 : __pyx_r = __pyx_t_1;
11162 0 : __pyx_t_1 = 0;
11163 0 : goto __pyx_L0;
11164 :
11165 : /* "View.MemoryView":560
11166 : * return result
11167 : *
11168 : * @property # <<<<<<<<<<<<<<
11169 : * def base(self):
11170 : * return self._get_base()
11171 : */
11172 :
11173 : /* function exit code */
11174 0 : __pyx_L1_error:;
11175 0 : __Pyx_XDECREF(__pyx_t_1);
11176 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11177 0 : __pyx_r = NULL;
11178 0 : __pyx_L0:;
11179 0 : __Pyx_XGIVEREF(__pyx_r);
11180 0 : __Pyx_RefNannyFinishContext();
11181 0 : return __pyx_r;
11182 : }
11183 :
11184 : /* "View.MemoryView":564
11185 : * return self._get_base()
11186 : *
11187 : * cdef _get_base(self): # <<<<<<<<<<<<<<
11188 : * return self.obj
11189 : *
11190 : */
11191 :
11192 2484 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
11193 2484 : PyObject *__pyx_r = NULL;
11194 : __Pyx_RefNannyDeclarations
11195 2484 : __Pyx_RefNannySetupContext("_get_base", 1);
11196 :
11197 : /* "View.MemoryView":565
11198 : *
11199 : * cdef _get_base(self):
11200 : * return self.obj # <<<<<<<<<<<<<<
11201 : *
11202 : * @property
11203 : */
11204 2484 : __Pyx_XDECREF(__pyx_r);
11205 2484 : __Pyx_INCREF(__pyx_v_self->obj);
11206 2484 : __pyx_r = __pyx_v_self->obj;
11207 2484 : goto __pyx_L0;
11208 :
11209 : /* "View.MemoryView":564
11210 : * return self._get_base()
11211 : *
11212 : * cdef _get_base(self): # <<<<<<<<<<<<<<
11213 : * return self.obj
11214 : *
11215 : */
11216 :
11217 : /* function exit code */
11218 2484 : __pyx_L0:;
11219 2484 : __Pyx_XGIVEREF(__pyx_r);
11220 2484 : __Pyx_RefNannyFinishContext();
11221 2484 : return __pyx_r;
11222 : }
11223 :
11224 : /* "View.MemoryView":567
11225 : * return self.obj
11226 : *
11227 : * @property # <<<<<<<<<<<<<<
11228 : * def shape(self):
11229 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11230 : */
11231 :
11232 : /* Python wrapper */
11233 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
11234 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
11235 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11236 0 : PyObject *__pyx_r = 0;
11237 : __Pyx_RefNannyDeclarations
11238 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11239 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11240 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11241 :
11242 : /* function exit code */
11243 0 : __Pyx_RefNannyFinishContext();
11244 0 : return __pyx_r;
11245 : }
11246 :
11247 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11248 0 : Py_ssize_t __pyx_7genexpr__pyx_v_length;
11249 0 : PyObject *__pyx_r = NULL;
11250 : __Pyx_RefNannyDeclarations
11251 0 : PyObject *__pyx_t_1 = NULL;
11252 0 : Py_ssize_t *__pyx_t_2;
11253 0 : Py_ssize_t *__pyx_t_3;
11254 0 : Py_ssize_t *__pyx_t_4;
11255 0 : PyObject *__pyx_t_5 = NULL;
11256 0 : int __pyx_lineno = 0;
11257 0 : const char *__pyx_filename = NULL;
11258 0 : int __pyx_clineno = 0;
11259 0 : __Pyx_RefNannySetupContext("__get__", 1);
11260 :
11261 : /* "View.MemoryView":569
11262 : * @property
11263 : * def shape(self):
11264 : * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
11265 : *
11266 : * @property
11267 : */
11268 0 : __Pyx_XDECREF(__pyx_r);
11269 0 : { /* enter inner scope */
11270 0 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
11271 0 : __Pyx_GOTREF(__pyx_t_1);
11272 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11273 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11274 0 : __pyx_t_2 = __pyx_t_4;
11275 0 : __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
11276 0 : __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
11277 0 : __Pyx_GOTREF(__pyx_t_5);
11278 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
11279 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11280 : }
11281 : } /* exit inner scope */
11282 0 : __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
11283 0 : __Pyx_GOTREF(__pyx_t_5);
11284 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11285 0 : __pyx_r = __pyx_t_5;
11286 0 : __pyx_t_5 = 0;
11287 0 : goto __pyx_L0;
11288 :
11289 : /* "View.MemoryView":567
11290 : * return self.obj
11291 : *
11292 : * @property # <<<<<<<<<<<<<<
11293 : * def shape(self):
11294 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11295 : */
11296 :
11297 : /* function exit code */
11298 0 : __pyx_L1_error:;
11299 0 : __Pyx_XDECREF(__pyx_t_1);
11300 0 : __Pyx_XDECREF(__pyx_t_5);
11301 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11302 0 : __pyx_r = NULL;
11303 0 : __pyx_L0:;
11304 0 : __Pyx_XGIVEREF(__pyx_r);
11305 0 : __Pyx_RefNannyFinishContext();
11306 0 : return __pyx_r;
11307 : }
11308 :
11309 : /* "View.MemoryView":571
11310 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11311 : *
11312 : * @property # <<<<<<<<<<<<<<
11313 : * def strides(self):
11314 : * if self.view.strides == NULL:
11315 : */
11316 :
11317 : /* Python wrapper */
11318 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
11319 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
11320 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11321 0 : PyObject *__pyx_r = 0;
11322 : __Pyx_RefNannyDeclarations
11323 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11324 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11325 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11326 :
11327 : /* function exit code */
11328 0 : __Pyx_RefNannyFinishContext();
11329 0 : return __pyx_r;
11330 : }
11331 :
11332 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11333 0 : Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
11334 0 : PyObject *__pyx_r = NULL;
11335 : __Pyx_RefNannyDeclarations
11336 0 : int __pyx_t_1;
11337 0 : PyObject *__pyx_t_2 = NULL;
11338 0 : Py_ssize_t *__pyx_t_3;
11339 0 : Py_ssize_t *__pyx_t_4;
11340 0 : Py_ssize_t *__pyx_t_5;
11341 0 : PyObject *__pyx_t_6 = NULL;
11342 0 : int __pyx_lineno = 0;
11343 0 : const char *__pyx_filename = NULL;
11344 0 : int __pyx_clineno = 0;
11345 0 : __Pyx_RefNannySetupContext("__get__", 1);
11346 :
11347 : /* "View.MemoryView":573
11348 : * @property
11349 : * def strides(self):
11350 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11351 : *
11352 : * raise ValueError, "Buffer view does not expose strides"
11353 : */
11354 0 : __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
11355 0 : if (unlikely(__pyx_t_1)) {
11356 :
11357 : /* "View.MemoryView":575
11358 : * if self.view.strides == NULL:
11359 : *
11360 : * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
11361 : *
11362 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11363 : */
11364 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
11365 0 : __PYX_ERR(1, 575, __pyx_L1_error)
11366 :
11367 : /* "View.MemoryView":573
11368 : * @property
11369 : * def strides(self):
11370 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
11371 : *
11372 : * raise ValueError, "Buffer view does not expose strides"
11373 : */
11374 : }
11375 :
11376 : /* "View.MemoryView":577
11377 : * raise ValueError, "Buffer view does not expose strides"
11378 : *
11379 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
11380 : *
11381 : * @property
11382 : */
11383 0 : __Pyx_XDECREF(__pyx_r);
11384 0 : { /* enter inner scope */
11385 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
11386 0 : __Pyx_GOTREF(__pyx_t_2);
11387 0 : __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
11388 0 : for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11389 0 : __pyx_t_3 = __pyx_t_5;
11390 0 : __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
11391 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
11392 0 : __Pyx_GOTREF(__pyx_t_6);
11393 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
11394 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11395 : }
11396 : } /* exit inner scope */
11397 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
11398 0 : __Pyx_GOTREF(__pyx_t_6);
11399 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11400 0 : __pyx_r = __pyx_t_6;
11401 0 : __pyx_t_6 = 0;
11402 0 : goto __pyx_L0;
11403 :
11404 : /* "View.MemoryView":571
11405 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
11406 : *
11407 : * @property # <<<<<<<<<<<<<<
11408 : * def strides(self):
11409 : * if self.view.strides == NULL:
11410 : */
11411 :
11412 : /* function exit code */
11413 0 : __pyx_L1_error:;
11414 0 : __Pyx_XDECREF(__pyx_t_2);
11415 0 : __Pyx_XDECREF(__pyx_t_6);
11416 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11417 0 : __pyx_r = NULL;
11418 0 : __pyx_L0:;
11419 0 : __Pyx_XGIVEREF(__pyx_r);
11420 0 : __Pyx_RefNannyFinishContext();
11421 0 : return __pyx_r;
11422 : }
11423 :
11424 : /* "View.MemoryView":579
11425 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11426 : *
11427 : * @property # <<<<<<<<<<<<<<
11428 : * def suboffsets(self):
11429 : * if self.view.suboffsets == NULL:
11430 : */
11431 :
11432 : /* Python wrapper */
11433 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
11434 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
11435 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11436 0 : PyObject *__pyx_r = 0;
11437 : __Pyx_RefNannyDeclarations
11438 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11439 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11440 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11441 :
11442 : /* function exit code */
11443 0 : __Pyx_RefNannyFinishContext();
11444 0 : return __pyx_r;
11445 : }
11446 :
11447 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11448 0 : Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
11449 0 : PyObject *__pyx_r = NULL;
11450 : __Pyx_RefNannyDeclarations
11451 0 : int __pyx_t_1;
11452 0 : PyObject *__pyx_t_2 = NULL;
11453 0 : Py_ssize_t *__pyx_t_3;
11454 0 : Py_ssize_t *__pyx_t_4;
11455 0 : Py_ssize_t *__pyx_t_5;
11456 0 : PyObject *__pyx_t_6 = NULL;
11457 0 : int __pyx_lineno = 0;
11458 0 : const char *__pyx_filename = NULL;
11459 0 : int __pyx_clineno = 0;
11460 0 : __Pyx_RefNannySetupContext("__get__", 1);
11461 :
11462 : /* "View.MemoryView":581
11463 : * @property
11464 : * def suboffsets(self):
11465 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11466 : * return (-1,) * self.view.ndim
11467 : *
11468 : */
11469 0 : __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
11470 0 : if (__pyx_t_1) {
11471 :
11472 : /* "View.MemoryView":582
11473 : * def suboffsets(self):
11474 : * if self.view.suboffsets == NULL:
11475 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
11476 : *
11477 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11478 : */
11479 0 : __Pyx_XDECREF(__pyx_r);
11480 0 : __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
11481 0 : __Pyx_GOTREF(__pyx_t_2);
11482 0 : __pyx_r = __pyx_t_2;
11483 0 : __pyx_t_2 = 0;
11484 0 : goto __pyx_L0;
11485 :
11486 : /* "View.MemoryView":581
11487 : * @property
11488 : * def suboffsets(self):
11489 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
11490 : * return (-1,) * self.view.ndim
11491 : *
11492 : */
11493 : }
11494 :
11495 : /* "View.MemoryView":584
11496 : * return (-1,) * self.view.ndim
11497 : *
11498 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
11499 : *
11500 : * @property
11501 : */
11502 0 : __Pyx_XDECREF(__pyx_r);
11503 0 : { /* enter inner scope */
11504 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
11505 0 : __Pyx_GOTREF(__pyx_t_2);
11506 0 : __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
11507 0 : for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
11508 0 : __pyx_t_3 = __pyx_t_5;
11509 0 : __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
11510 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
11511 0 : __Pyx_GOTREF(__pyx_t_6);
11512 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
11513 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11514 : }
11515 : } /* exit inner scope */
11516 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
11517 0 : __Pyx_GOTREF(__pyx_t_6);
11518 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11519 0 : __pyx_r = __pyx_t_6;
11520 0 : __pyx_t_6 = 0;
11521 0 : goto __pyx_L0;
11522 :
11523 : /* "View.MemoryView":579
11524 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
11525 : *
11526 : * @property # <<<<<<<<<<<<<<
11527 : * def suboffsets(self):
11528 : * if self.view.suboffsets == NULL:
11529 : */
11530 :
11531 : /* function exit code */
11532 0 : __pyx_L1_error:;
11533 0 : __Pyx_XDECREF(__pyx_t_2);
11534 0 : __Pyx_XDECREF(__pyx_t_6);
11535 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11536 0 : __pyx_r = NULL;
11537 0 : __pyx_L0:;
11538 0 : __Pyx_XGIVEREF(__pyx_r);
11539 0 : __Pyx_RefNannyFinishContext();
11540 0 : return __pyx_r;
11541 : }
11542 :
11543 : /* "View.MemoryView":586
11544 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11545 : *
11546 : * @property # <<<<<<<<<<<<<<
11547 : * def ndim(self):
11548 : * return self.view.ndim
11549 : */
11550 :
11551 : /* Python wrapper */
11552 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
11553 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
11554 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11555 0 : PyObject *__pyx_r = 0;
11556 : __Pyx_RefNannyDeclarations
11557 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11558 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11559 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11560 :
11561 : /* function exit code */
11562 0 : __Pyx_RefNannyFinishContext();
11563 0 : return __pyx_r;
11564 : }
11565 :
11566 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11567 0 : PyObject *__pyx_r = NULL;
11568 : __Pyx_RefNannyDeclarations
11569 0 : PyObject *__pyx_t_1 = NULL;
11570 0 : int __pyx_lineno = 0;
11571 0 : const char *__pyx_filename = NULL;
11572 0 : int __pyx_clineno = 0;
11573 0 : __Pyx_RefNannySetupContext("__get__", 1);
11574 :
11575 : /* "View.MemoryView":588
11576 : * @property
11577 : * def ndim(self):
11578 : * return self.view.ndim # <<<<<<<<<<<<<<
11579 : *
11580 : * @property
11581 : */
11582 0 : __Pyx_XDECREF(__pyx_r);
11583 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
11584 0 : __Pyx_GOTREF(__pyx_t_1);
11585 0 : __pyx_r = __pyx_t_1;
11586 0 : __pyx_t_1 = 0;
11587 0 : goto __pyx_L0;
11588 :
11589 : /* "View.MemoryView":586
11590 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
11591 : *
11592 : * @property # <<<<<<<<<<<<<<
11593 : * def ndim(self):
11594 : * return self.view.ndim
11595 : */
11596 :
11597 : /* function exit code */
11598 0 : __pyx_L1_error:;
11599 0 : __Pyx_XDECREF(__pyx_t_1);
11600 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11601 0 : __pyx_r = NULL;
11602 0 : __pyx_L0:;
11603 0 : __Pyx_XGIVEREF(__pyx_r);
11604 0 : __Pyx_RefNannyFinishContext();
11605 0 : return __pyx_r;
11606 : }
11607 :
11608 : /* "View.MemoryView":590
11609 : * return self.view.ndim
11610 : *
11611 : * @property # <<<<<<<<<<<<<<
11612 : * def itemsize(self):
11613 : * return self.view.itemsize
11614 : */
11615 :
11616 : /* Python wrapper */
11617 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
11618 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
11619 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11620 0 : PyObject *__pyx_r = 0;
11621 : __Pyx_RefNannyDeclarations
11622 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11623 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11624 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11625 :
11626 : /* function exit code */
11627 0 : __Pyx_RefNannyFinishContext();
11628 0 : return __pyx_r;
11629 : }
11630 :
11631 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11632 0 : PyObject *__pyx_r = NULL;
11633 : __Pyx_RefNannyDeclarations
11634 0 : PyObject *__pyx_t_1 = NULL;
11635 0 : int __pyx_lineno = 0;
11636 0 : const char *__pyx_filename = NULL;
11637 0 : int __pyx_clineno = 0;
11638 0 : __Pyx_RefNannySetupContext("__get__", 1);
11639 :
11640 : /* "View.MemoryView":592
11641 : * @property
11642 : * def itemsize(self):
11643 : * return self.view.itemsize # <<<<<<<<<<<<<<
11644 : *
11645 : * @property
11646 : */
11647 0 : __Pyx_XDECREF(__pyx_r);
11648 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
11649 0 : __Pyx_GOTREF(__pyx_t_1);
11650 0 : __pyx_r = __pyx_t_1;
11651 0 : __pyx_t_1 = 0;
11652 0 : goto __pyx_L0;
11653 :
11654 : /* "View.MemoryView":590
11655 : * return self.view.ndim
11656 : *
11657 : * @property # <<<<<<<<<<<<<<
11658 : * def itemsize(self):
11659 : * return self.view.itemsize
11660 : */
11661 :
11662 : /* function exit code */
11663 0 : __pyx_L1_error:;
11664 0 : __Pyx_XDECREF(__pyx_t_1);
11665 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11666 0 : __pyx_r = NULL;
11667 0 : __pyx_L0:;
11668 0 : __Pyx_XGIVEREF(__pyx_r);
11669 0 : __Pyx_RefNannyFinishContext();
11670 0 : return __pyx_r;
11671 : }
11672 :
11673 : /* "View.MemoryView":594
11674 : * return self.view.itemsize
11675 : *
11676 : * @property # <<<<<<<<<<<<<<
11677 : * def nbytes(self):
11678 : * return self.size * self.view.itemsize
11679 : */
11680 :
11681 : /* Python wrapper */
11682 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
11683 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
11684 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11685 0 : PyObject *__pyx_r = 0;
11686 : __Pyx_RefNannyDeclarations
11687 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11688 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11689 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11690 :
11691 : /* function exit code */
11692 0 : __Pyx_RefNannyFinishContext();
11693 0 : return __pyx_r;
11694 : }
11695 :
11696 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11697 0 : PyObject *__pyx_r = NULL;
11698 : __Pyx_RefNannyDeclarations
11699 0 : PyObject *__pyx_t_1 = NULL;
11700 0 : PyObject *__pyx_t_2 = NULL;
11701 0 : PyObject *__pyx_t_3 = NULL;
11702 0 : int __pyx_lineno = 0;
11703 0 : const char *__pyx_filename = NULL;
11704 0 : int __pyx_clineno = 0;
11705 0 : __Pyx_RefNannySetupContext("__get__", 1);
11706 :
11707 : /* "View.MemoryView":596
11708 : * @property
11709 : * def nbytes(self):
11710 : * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
11711 : *
11712 : * @property
11713 : */
11714 0 : __Pyx_XDECREF(__pyx_r);
11715 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
11716 0 : __Pyx_GOTREF(__pyx_t_1);
11717 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
11718 0 : __Pyx_GOTREF(__pyx_t_2);
11719 0 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
11720 0 : __Pyx_GOTREF(__pyx_t_3);
11721 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11722 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11723 0 : __pyx_r = __pyx_t_3;
11724 0 : __pyx_t_3 = 0;
11725 0 : goto __pyx_L0;
11726 :
11727 : /* "View.MemoryView":594
11728 : * return self.view.itemsize
11729 : *
11730 : * @property # <<<<<<<<<<<<<<
11731 : * def nbytes(self):
11732 : * return self.size * self.view.itemsize
11733 : */
11734 :
11735 : /* function exit code */
11736 0 : __pyx_L1_error:;
11737 0 : __Pyx_XDECREF(__pyx_t_1);
11738 0 : __Pyx_XDECREF(__pyx_t_2);
11739 0 : __Pyx_XDECREF(__pyx_t_3);
11740 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11741 0 : __pyx_r = NULL;
11742 0 : __pyx_L0:;
11743 0 : __Pyx_XGIVEREF(__pyx_r);
11744 0 : __Pyx_RefNannyFinishContext();
11745 0 : return __pyx_r;
11746 : }
11747 :
11748 : /* "View.MemoryView":598
11749 : * return self.size * self.view.itemsize
11750 : *
11751 : * @property # <<<<<<<<<<<<<<
11752 : * def size(self):
11753 : * if self._size is None:
11754 : */
11755 :
11756 : /* Python wrapper */
11757 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
11758 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
11759 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11760 0 : PyObject *__pyx_r = 0;
11761 : __Pyx_RefNannyDeclarations
11762 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
11763 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11764 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11765 :
11766 : /* function exit code */
11767 0 : __Pyx_RefNannyFinishContext();
11768 0 : return __pyx_r;
11769 : }
11770 :
11771 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
11772 0 : PyObject *__pyx_v_result = NULL;
11773 0 : PyObject *__pyx_v_length = NULL;
11774 0 : PyObject *__pyx_r = NULL;
11775 : __Pyx_RefNannyDeclarations
11776 0 : int __pyx_t_1;
11777 0 : Py_ssize_t *__pyx_t_2;
11778 0 : Py_ssize_t *__pyx_t_3;
11779 0 : Py_ssize_t *__pyx_t_4;
11780 0 : PyObject *__pyx_t_5 = NULL;
11781 0 : int __pyx_lineno = 0;
11782 0 : const char *__pyx_filename = NULL;
11783 0 : int __pyx_clineno = 0;
11784 0 : __Pyx_RefNannySetupContext("__get__", 1);
11785 :
11786 : /* "View.MemoryView":600
11787 : * @property
11788 : * def size(self):
11789 : * if self._size is None: # <<<<<<<<<<<<<<
11790 : * result = 1
11791 : *
11792 : */
11793 0 : __pyx_t_1 = (__pyx_v_self->_size == Py_None);
11794 0 : if (__pyx_t_1) {
11795 :
11796 : /* "View.MemoryView":601
11797 : * def size(self):
11798 : * if self._size is None:
11799 : * result = 1 # <<<<<<<<<<<<<<
11800 : *
11801 : * for length in self.view.shape[:self.view.ndim]:
11802 : */
11803 0 : __Pyx_INCREF(__pyx_int_1);
11804 0 : __pyx_v_result = __pyx_int_1;
11805 :
11806 : /* "View.MemoryView":603
11807 : * result = 1
11808 : *
11809 : * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
11810 : * result *= length
11811 : *
11812 : */
11813 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
11814 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
11815 0 : __pyx_t_2 = __pyx_t_4;
11816 0 : __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
11817 0 : __Pyx_GOTREF(__pyx_t_5);
11818 0 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
11819 0 : __pyx_t_5 = 0;
11820 :
11821 : /* "View.MemoryView":604
11822 : *
11823 : * for length in self.view.shape[:self.view.ndim]:
11824 : * result *= length # <<<<<<<<<<<<<<
11825 : *
11826 : * self._size = result
11827 : */
11828 0 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
11829 0 : __Pyx_GOTREF(__pyx_t_5);
11830 0 : __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
11831 0 : __pyx_t_5 = 0;
11832 : }
11833 :
11834 : /* "View.MemoryView":606
11835 : * result *= length
11836 : *
11837 : * self._size = result # <<<<<<<<<<<<<<
11838 : *
11839 : * return self._size
11840 : */
11841 0 : __Pyx_INCREF(__pyx_v_result);
11842 0 : __Pyx_GIVEREF(__pyx_v_result);
11843 0 : __Pyx_GOTREF(__pyx_v_self->_size);
11844 0 : __Pyx_DECREF(__pyx_v_self->_size);
11845 0 : __pyx_v_self->_size = __pyx_v_result;
11846 :
11847 : /* "View.MemoryView":600
11848 : * @property
11849 : * def size(self):
11850 : * if self._size is None: # <<<<<<<<<<<<<<
11851 : * result = 1
11852 : *
11853 : */
11854 : }
11855 :
11856 : /* "View.MemoryView":608
11857 : * self._size = result
11858 : *
11859 : * return self._size # <<<<<<<<<<<<<<
11860 : *
11861 : * def __len__(self):
11862 : */
11863 0 : __Pyx_XDECREF(__pyx_r);
11864 0 : __Pyx_INCREF(__pyx_v_self->_size);
11865 0 : __pyx_r = __pyx_v_self->_size;
11866 0 : goto __pyx_L0;
11867 :
11868 : /* "View.MemoryView":598
11869 : * return self.size * self.view.itemsize
11870 : *
11871 : * @property # <<<<<<<<<<<<<<
11872 : * def size(self):
11873 : * if self._size is None:
11874 : */
11875 :
11876 : /* function exit code */
11877 0 : __pyx_L1_error:;
11878 0 : __Pyx_XDECREF(__pyx_t_5);
11879 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11880 0 : __pyx_r = NULL;
11881 0 : __pyx_L0:;
11882 0 : __Pyx_XDECREF(__pyx_v_result);
11883 0 : __Pyx_XDECREF(__pyx_v_length);
11884 0 : __Pyx_XGIVEREF(__pyx_r);
11885 0 : __Pyx_RefNannyFinishContext();
11886 0 : return __pyx_r;
11887 : }
11888 :
11889 : /* "View.MemoryView":610
11890 : * return self._size
11891 : *
11892 : * def __len__(self): # <<<<<<<<<<<<<<
11893 : * if self.view.ndim >= 1:
11894 : * return self.view.shape[0]
11895 : */
11896 :
11897 : /* Python wrapper */
11898 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
11899 0 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
11900 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11901 0 : Py_ssize_t __pyx_r;
11902 : __Pyx_RefNannyDeclarations
11903 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
11904 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11905 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11906 :
11907 : /* function exit code */
11908 0 : __Pyx_RefNannyFinishContext();
11909 0 : return __pyx_r;
11910 : }
11911 :
11912 0 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
11913 0 : Py_ssize_t __pyx_r;
11914 0 : int __pyx_t_1;
11915 :
11916 : /* "View.MemoryView":611
11917 : *
11918 : * def __len__(self):
11919 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11920 : * return self.view.shape[0]
11921 : *
11922 : */
11923 0 : __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11924 0 : if (__pyx_t_1) {
11925 :
11926 : /* "View.MemoryView":612
11927 : * def __len__(self):
11928 : * if self.view.ndim >= 1:
11929 : * return self.view.shape[0] # <<<<<<<<<<<<<<
11930 : *
11931 : * return 0
11932 : */
11933 0 : __pyx_r = (__pyx_v_self->view.shape[0]);
11934 0 : goto __pyx_L0;
11935 :
11936 : /* "View.MemoryView":611
11937 : *
11938 : * def __len__(self):
11939 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11940 : * return self.view.shape[0]
11941 : *
11942 : */
11943 : }
11944 :
11945 : /* "View.MemoryView":614
11946 : * return self.view.shape[0]
11947 : *
11948 : * return 0 # <<<<<<<<<<<<<<
11949 : *
11950 : * def __repr__(self):
11951 : */
11952 0 : __pyx_r = 0;
11953 0 : goto __pyx_L0;
11954 :
11955 : /* "View.MemoryView":610
11956 : * return self._size
11957 : *
11958 : * def __len__(self): # <<<<<<<<<<<<<<
11959 : * if self.view.ndim >= 1:
11960 : * return self.view.shape[0]
11961 : */
11962 :
11963 : /* function exit code */
11964 0 : __pyx_L0:;
11965 0 : return __pyx_r;
11966 : }
11967 :
11968 : /* "View.MemoryView":616
11969 : * return 0
11970 : *
11971 : * def __repr__(self): # <<<<<<<<<<<<<<
11972 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11973 : * id(self))
11974 : */
11975 :
11976 : /* Python wrapper */
11977 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11978 0 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11979 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11980 0 : PyObject *__pyx_r = 0;
11981 : __Pyx_RefNannyDeclarations
11982 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11983 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11984 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11985 :
11986 : /* function exit code */
11987 0 : __Pyx_RefNannyFinishContext();
11988 0 : return __pyx_r;
11989 : }
11990 :
11991 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11992 0 : PyObject *__pyx_r = NULL;
11993 : __Pyx_RefNannyDeclarations
11994 0 : PyObject *__pyx_t_1 = NULL;
11995 0 : PyObject *__pyx_t_2 = NULL;
11996 0 : PyObject *__pyx_t_3 = NULL;
11997 0 : int __pyx_lineno = 0;
11998 0 : const char *__pyx_filename = NULL;
11999 0 : int __pyx_clineno = 0;
12000 0 : __Pyx_RefNannySetupContext("__repr__", 1);
12001 :
12002 : /* "View.MemoryView":617
12003 : *
12004 : * def __repr__(self):
12005 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12006 : * id(self))
12007 : *
12008 : */
12009 0 : __Pyx_XDECREF(__pyx_r);
12010 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
12011 0 : __Pyx_GOTREF(__pyx_t_1);
12012 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
12013 0 : __Pyx_GOTREF(__pyx_t_2);
12014 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12015 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
12016 0 : __Pyx_GOTREF(__pyx_t_1);
12017 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12018 :
12019 : /* "View.MemoryView":618
12020 : * def __repr__(self):
12021 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12022 : * id(self)) # <<<<<<<<<<<<<<
12023 : *
12024 : * def __str__(self):
12025 : */
12026 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
12027 0 : __Pyx_GOTREF(__pyx_t_2);
12028 :
12029 : /* "View.MemoryView":617
12030 : *
12031 : * def __repr__(self):
12032 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
12033 : * id(self))
12034 : *
12035 : */
12036 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 617, __pyx_L1_error)
12037 0 : __Pyx_GOTREF(__pyx_t_3);
12038 0 : __Pyx_GIVEREF(__pyx_t_1);
12039 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error);
12040 0 : __Pyx_GIVEREF(__pyx_t_2);
12041 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error);
12042 0 : __pyx_t_1 = 0;
12043 0 : __pyx_t_2 = 0;
12044 0 : __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
12045 0 : __Pyx_GOTREF(__pyx_t_2);
12046 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12047 0 : __pyx_r = __pyx_t_2;
12048 0 : __pyx_t_2 = 0;
12049 0 : goto __pyx_L0;
12050 :
12051 : /* "View.MemoryView":616
12052 : * return 0
12053 : *
12054 : * def __repr__(self): # <<<<<<<<<<<<<<
12055 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
12056 : * id(self))
12057 : */
12058 :
12059 : /* function exit code */
12060 0 : __pyx_L1_error:;
12061 0 : __Pyx_XDECREF(__pyx_t_1);
12062 0 : __Pyx_XDECREF(__pyx_t_2);
12063 0 : __Pyx_XDECREF(__pyx_t_3);
12064 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12065 0 : __pyx_r = NULL;
12066 0 : __pyx_L0:;
12067 0 : __Pyx_XGIVEREF(__pyx_r);
12068 0 : __Pyx_RefNannyFinishContext();
12069 0 : return __pyx_r;
12070 : }
12071 :
12072 : /* "View.MemoryView":620
12073 : * id(self))
12074 : *
12075 : * def __str__(self): # <<<<<<<<<<<<<<
12076 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12077 : *
12078 : */
12079 :
12080 : /* Python wrapper */
12081 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
12082 0 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
12083 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12084 0 : PyObject *__pyx_r = 0;
12085 : __Pyx_RefNannyDeclarations
12086 0 : __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
12087 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
12088 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12089 :
12090 : /* function exit code */
12091 0 : __Pyx_RefNannyFinishContext();
12092 0 : return __pyx_r;
12093 : }
12094 :
12095 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
12096 0 : PyObject *__pyx_r = NULL;
12097 : __Pyx_RefNannyDeclarations
12098 0 : PyObject *__pyx_t_1 = NULL;
12099 0 : PyObject *__pyx_t_2 = NULL;
12100 0 : int __pyx_lineno = 0;
12101 0 : const char *__pyx_filename = NULL;
12102 0 : int __pyx_clineno = 0;
12103 0 : __Pyx_RefNannySetupContext("__str__", 1);
12104 :
12105 : /* "View.MemoryView":621
12106 : *
12107 : * def __str__(self):
12108 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
12109 : *
12110 : *
12111 : */
12112 0 : __Pyx_XDECREF(__pyx_r);
12113 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
12114 0 : __Pyx_GOTREF(__pyx_t_1);
12115 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
12116 0 : __Pyx_GOTREF(__pyx_t_2);
12117 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12118 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
12119 0 : __Pyx_GOTREF(__pyx_t_1);
12120 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12121 0 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
12122 0 : __Pyx_GOTREF(__pyx_t_2);
12123 0 : __Pyx_GIVEREF(__pyx_t_1);
12124 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error);
12125 0 : __pyx_t_1 = 0;
12126 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
12127 0 : __Pyx_GOTREF(__pyx_t_1);
12128 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12129 0 : __pyx_r = __pyx_t_1;
12130 0 : __pyx_t_1 = 0;
12131 0 : goto __pyx_L0;
12132 :
12133 : /* "View.MemoryView":620
12134 : * id(self))
12135 : *
12136 : * def __str__(self): # <<<<<<<<<<<<<<
12137 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
12138 : *
12139 : */
12140 :
12141 : /* function exit code */
12142 0 : __pyx_L1_error:;
12143 0 : __Pyx_XDECREF(__pyx_t_1);
12144 0 : __Pyx_XDECREF(__pyx_t_2);
12145 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12146 0 : __pyx_r = NULL;
12147 0 : __pyx_L0:;
12148 0 : __Pyx_XGIVEREF(__pyx_r);
12149 0 : __Pyx_RefNannyFinishContext();
12150 0 : return __pyx_r;
12151 : }
12152 :
12153 : /* "View.MemoryView":624
12154 : *
12155 : *
12156 : * def is_c_contig(self): # <<<<<<<<<<<<<<
12157 : * cdef __Pyx_memviewslice *mslice
12158 : * cdef __Pyx_memviewslice tmp
12159 : */
12160 :
12161 : /* Python wrapper */
12162 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
12163 : #if CYTHON_METH_FASTCALL
12164 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12165 : #else
12166 : PyObject *__pyx_args, PyObject *__pyx_kwds
12167 : #endif
12168 : ); /*proto*/
12169 0 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
12170 : #if CYTHON_METH_FASTCALL
12171 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12172 : #else
12173 : PyObject *__pyx_args, PyObject *__pyx_kwds
12174 : #endif
12175 : ) {
12176 : #if !CYTHON_METH_FASTCALL
12177 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12178 : #endif
12179 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12180 0 : PyObject *__pyx_r = 0;
12181 : __Pyx_RefNannyDeclarations
12182 0 : __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
12183 : #if !CYTHON_METH_FASTCALL
12184 : #if CYTHON_ASSUME_SAFE_MACROS
12185 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12186 : #else
12187 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12188 : #endif
12189 : #endif
12190 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12191 0 : if (unlikely(__pyx_nargs > 0)) {
12192 0 : __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
12193 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
12194 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12195 :
12196 : /* function exit code */
12197 0 : __Pyx_RefNannyFinishContext();
12198 0 : return __pyx_r;
12199 : }
12200 :
12201 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12202 0 : __Pyx_memviewslice *__pyx_v_mslice;
12203 0 : __Pyx_memviewslice __pyx_v_tmp;
12204 0 : PyObject *__pyx_r = NULL;
12205 : __Pyx_RefNannyDeclarations
12206 0 : __Pyx_memviewslice *__pyx_t_1;
12207 0 : PyObject *__pyx_t_2 = NULL;
12208 0 : int __pyx_lineno = 0;
12209 0 : const char *__pyx_filename = NULL;
12210 0 : int __pyx_clineno = 0;
12211 0 : __Pyx_RefNannySetupContext("is_c_contig", 1);
12212 :
12213 : /* "View.MemoryView":627
12214 : * cdef __Pyx_memviewslice *mslice
12215 : * cdef __Pyx_memviewslice tmp
12216 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12217 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12218 : *
12219 : */
12220 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 627, __pyx_L1_error)
12221 0 : __pyx_v_mslice = __pyx_t_1;
12222 :
12223 : /* "View.MemoryView":628
12224 : * cdef __Pyx_memviewslice tmp
12225 : * mslice = get_slice_from_memview(self, &tmp)
12226 : * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
12227 : *
12228 : * def is_f_contig(self):
12229 : */
12230 0 : __Pyx_XDECREF(__pyx_r);
12231 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
12232 0 : __Pyx_GOTREF(__pyx_t_2);
12233 0 : __pyx_r = __pyx_t_2;
12234 0 : __pyx_t_2 = 0;
12235 0 : goto __pyx_L0;
12236 :
12237 : /* "View.MemoryView":624
12238 : *
12239 : *
12240 : * def is_c_contig(self): # <<<<<<<<<<<<<<
12241 : * cdef __Pyx_memviewslice *mslice
12242 : * cdef __Pyx_memviewslice tmp
12243 : */
12244 :
12245 : /* function exit code */
12246 0 : __pyx_L1_error:;
12247 0 : __Pyx_XDECREF(__pyx_t_2);
12248 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12249 : __pyx_r = NULL;
12250 0 : __pyx_L0:;
12251 0 : __Pyx_XGIVEREF(__pyx_r);
12252 0 : __Pyx_RefNannyFinishContext();
12253 0 : return __pyx_r;
12254 : }
12255 :
12256 : /* "View.MemoryView":630
12257 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12258 : *
12259 : * def is_f_contig(self): # <<<<<<<<<<<<<<
12260 : * cdef __Pyx_memviewslice *mslice
12261 : * cdef __Pyx_memviewslice tmp
12262 : */
12263 :
12264 : /* Python wrapper */
12265 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
12266 : #if CYTHON_METH_FASTCALL
12267 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12268 : #else
12269 : PyObject *__pyx_args, PyObject *__pyx_kwds
12270 : #endif
12271 : ); /*proto*/
12272 0 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
12273 : #if CYTHON_METH_FASTCALL
12274 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12275 : #else
12276 : PyObject *__pyx_args, PyObject *__pyx_kwds
12277 : #endif
12278 : ) {
12279 : #if !CYTHON_METH_FASTCALL
12280 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12281 : #endif
12282 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12283 0 : PyObject *__pyx_r = 0;
12284 : __Pyx_RefNannyDeclarations
12285 0 : __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
12286 : #if !CYTHON_METH_FASTCALL
12287 : #if CYTHON_ASSUME_SAFE_MACROS
12288 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12289 : #else
12290 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12291 : #endif
12292 : #endif
12293 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12294 0 : if (unlikely(__pyx_nargs > 0)) {
12295 0 : __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
12296 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
12297 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
12298 :
12299 : /* function exit code */
12300 0 : __Pyx_RefNannyFinishContext();
12301 0 : return __pyx_r;
12302 : }
12303 :
12304 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
12305 0 : __Pyx_memviewslice *__pyx_v_mslice;
12306 0 : __Pyx_memviewslice __pyx_v_tmp;
12307 0 : PyObject *__pyx_r = NULL;
12308 : __Pyx_RefNannyDeclarations
12309 0 : __Pyx_memviewslice *__pyx_t_1;
12310 0 : PyObject *__pyx_t_2 = NULL;
12311 0 : int __pyx_lineno = 0;
12312 0 : const char *__pyx_filename = NULL;
12313 0 : int __pyx_clineno = 0;
12314 0 : __Pyx_RefNannySetupContext("is_f_contig", 1);
12315 :
12316 : /* "View.MemoryView":633
12317 : * cdef __Pyx_memviewslice *mslice
12318 : * cdef __Pyx_memviewslice tmp
12319 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
12320 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12321 : *
12322 : */
12323 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 633, __pyx_L1_error)
12324 0 : __pyx_v_mslice = __pyx_t_1;
12325 :
12326 : /* "View.MemoryView":634
12327 : * cdef __Pyx_memviewslice tmp
12328 : * mslice = get_slice_from_memview(self, &tmp)
12329 : * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
12330 : *
12331 : * def copy(self):
12332 : */
12333 0 : __Pyx_XDECREF(__pyx_r);
12334 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
12335 0 : __Pyx_GOTREF(__pyx_t_2);
12336 0 : __pyx_r = __pyx_t_2;
12337 0 : __pyx_t_2 = 0;
12338 0 : goto __pyx_L0;
12339 :
12340 : /* "View.MemoryView":630
12341 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
12342 : *
12343 : * def is_f_contig(self): # <<<<<<<<<<<<<<
12344 : * cdef __Pyx_memviewslice *mslice
12345 : * cdef __Pyx_memviewslice tmp
12346 : */
12347 :
12348 : /* function exit code */
12349 0 : __pyx_L1_error:;
12350 0 : __Pyx_XDECREF(__pyx_t_2);
12351 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
12352 : __pyx_r = NULL;
12353 0 : __pyx_L0:;
12354 0 : __Pyx_XGIVEREF(__pyx_r);
12355 0 : __Pyx_RefNannyFinishContext();
12356 0 : return __pyx_r;
12357 : }
12358 :
12359 : /* "View.MemoryView":636
12360 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12361 : *
12362 : * def copy(self): # <<<<<<<<<<<<<<
12363 : * cdef __Pyx_memviewslice mslice
12364 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12365 : */
12366 :
12367 : /* Python wrapper */
12368 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12369 : #if CYTHON_METH_FASTCALL
12370 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12371 : #else
12372 : PyObject *__pyx_args, PyObject *__pyx_kwds
12373 : #endif
12374 : ); /*proto*/
12375 0 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
12376 : #if CYTHON_METH_FASTCALL
12377 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12378 : #else
12379 : PyObject *__pyx_args, PyObject *__pyx_kwds
12380 : #endif
12381 : ) {
12382 : #if !CYTHON_METH_FASTCALL
12383 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12384 : #endif
12385 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12386 0 : PyObject *__pyx_r = 0;
12387 : __Pyx_RefNannyDeclarations
12388 0 : __Pyx_RefNannySetupContext("copy (wrapper)", 0);
12389 : #if !CYTHON_METH_FASTCALL
12390 : #if CYTHON_ASSUME_SAFE_MACROS
12391 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12392 : #else
12393 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12394 : #endif
12395 : #endif
12396 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12397 0 : if (unlikely(__pyx_nargs > 0)) {
12398 0 : __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
12399 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
12400 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
12401 :
12402 : /* function exit code */
12403 0 : __Pyx_RefNannyFinishContext();
12404 0 : return __pyx_r;
12405 : }
12406 :
12407 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
12408 0 : __Pyx_memviewslice __pyx_v_mslice;
12409 0 : int __pyx_v_flags;
12410 0 : PyObject *__pyx_r = NULL;
12411 : __Pyx_RefNannyDeclarations
12412 0 : __Pyx_memviewslice __pyx_t_1;
12413 0 : PyObject *__pyx_t_2 = NULL;
12414 0 : int __pyx_lineno = 0;
12415 0 : const char *__pyx_filename = NULL;
12416 0 : int __pyx_clineno = 0;
12417 0 : __Pyx_RefNannySetupContext("copy", 1);
12418 :
12419 : /* "View.MemoryView":638
12420 : * def copy(self):
12421 : * cdef __Pyx_memviewslice mslice
12422 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
12423 : *
12424 : * slice_copy(self, &mslice)
12425 : */
12426 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
12427 :
12428 : /* "View.MemoryView":640
12429 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12430 : *
12431 : * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
12432 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
12433 : * self.view.itemsize,
12434 : */
12435 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
12436 :
12437 : /* "View.MemoryView":641
12438 : *
12439 : * slice_copy(self, &mslice)
12440 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
12441 : * self.view.itemsize,
12442 : * flags|PyBUF_C_CONTIGUOUS,
12443 : */
12444 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
12445 0 : __pyx_v_mslice = __pyx_t_1;
12446 :
12447 : /* "View.MemoryView":646
12448 : * self.dtype_is_object)
12449 : *
12450 : * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
12451 : *
12452 : * def copy_fortran(self):
12453 : */
12454 0 : __Pyx_XDECREF(__pyx_r);
12455 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
12456 0 : __Pyx_GOTREF(__pyx_t_2);
12457 0 : __pyx_r = __pyx_t_2;
12458 0 : __pyx_t_2 = 0;
12459 0 : goto __pyx_L0;
12460 :
12461 : /* "View.MemoryView":636
12462 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
12463 : *
12464 : * def copy(self): # <<<<<<<<<<<<<<
12465 : * cdef __Pyx_memviewslice mslice
12466 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
12467 : */
12468 :
12469 : /* function exit code */
12470 0 : __pyx_L1_error:;
12471 0 : __Pyx_XDECREF(__pyx_t_2);
12472 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
12473 : __pyx_r = NULL;
12474 0 : __pyx_L0:;
12475 0 : __Pyx_XGIVEREF(__pyx_r);
12476 0 : __Pyx_RefNannyFinishContext();
12477 0 : return __pyx_r;
12478 : }
12479 :
12480 : /* "View.MemoryView":648
12481 : * return memoryview_copy_from_slice(self, &mslice)
12482 : *
12483 : * def copy_fortran(self): # <<<<<<<<<<<<<<
12484 : * cdef __Pyx_memviewslice src, dst
12485 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12486 : */
12487 :
12488 : /* Python wrapper */
12489 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12490 : #if CYTHON_METH_FASTCALL
12491 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12492 : #else
12493 : PyObject *__pyx_args, PyObject *__pyx_kwds
12494 : #endif
12495 : ); /*proto*/
12496 0 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
12497 : #if CYTHON_METH_FASTCALL
12498 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12499 : #else
12500 : PyObject *__pyx_args, PyObject *__pyx_kwds
12501 : #endif
12502 : ) {
12503 : #if !CYTHON_METH_FASTCALL
12504 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12505 : #endif
12506 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12507 0 : PyObject *__pyx_r = 0;
12508 : __Pyx_RefNannyDeclarations
12509 0 : __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
12510 : #if !CYTHON_METH_FASTCALL
12511 : #if CYTHON_ASSUME_SAFE_MACROS
12512 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12513 : #else
12514 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12515 : #endif
12516 : #endif
12517 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12518 0 : if (unlikely(__pyx_nargs > 0)) {
12519 0 : __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
12520 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
12521 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
12522 :
12523 : /* function exit code */
12524 0 : __Pyx_RefNannyFinishContext();
12525 0 : return __pyx_r;
12526 : }
12527 :
12528 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
12529 0 : __Pyx_memviewslice __pyx_v_src;
12530 0 : __Pyx_memviewslice __pyx_v_dst;
12531 0 : int __pyx_v_flags;
12532 0 : PyObject *__pyx_r = NULL;
12533 : __Pyx_RefNannyDeclarations
12534 0 : __Pyx_memviewslice __pyx_t_1;
12535 0 : PyObject *__pyx_t_2 = NULL;
12536 0 : int __pyx_lineno = 0;
12537 0 : const char *__pyx_filename = NULL;
12538 0 : int __pyx_clineno = 0;
12539 0 : __Pyx_RefNannySetupContext("copy_fortran", 1);
12540 :
12541 : /* "View.MemoryView":650
12542 : * def copy_fortran(self):
12543 : * cdef __Pyx_memviewslice src, dst
12544 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
12545 : *
12546 : * slice_copy(self, &src)
12547 : */
12548 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
12549 :
12550 : /* "View.MemoryView":652
12551 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12552 : *
12553 : * slice_copy(self, &src) # <<<<<<<<<<<<<<
12554 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
12555 : * self.view.itemsize,
12556 : */
12557 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
12558 :
12559 : /* "View.MemoryView":653
12560 : *
12561 : * slice_copy(self, &src)
12562 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
12563 : * self.view.itemsize,
12564 : * flags|PyBUF_F_CONTIGUOUS,
12565 : */
12566 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
12567 0 : __pyx_v_dst = __pyx_t_1;
12568 :
12569 : /* "View.MemoryView":658
12570 : * self.dtype_is_object)
12571 : *
12572 : * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
12573 : *
12574 : *
12575 : */
12576 0 : __Pyx_XDECREF(__pyx_r);
12577 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
12578 0 : __Pyx_GOTREF(__pyx_t_2);
12579 0 : __pyx_r = __pyx_t_2;
12580 0 : __pyx_t_2 = 0;
12581 0 : goto __pyx_L0;
12582 :
12583 : /* "View.MemoryView":648
12584 : * return memoryview_copy_from_slice(self, &mslice)
12585 : *
12586 : * def copy_fortran(self): # <<<<<<<<<<<<<<
12587 : * cdef __Pyx_memviewslice src, dst
12588 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
12589 : */
12590 :
12591 : /* function exit code */
12592 0 : __pyx_L1_error:;
12593 0 : __Pyx_XDECREF(__pyx_t_2);
12594 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
12595 : __pyx_r = NULL;
12596 0 : __pyx_L0:;
12597 0 : __Pyx_XGIVEREF(__pyx_r);
12598 0 : __Pyx_RefNannyFinishContext();
12599 0 : return __pyx_r;
12600 : }
12601 :
12602 : /* "(tree fragment)":1
12603 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12604 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12605 : * def __setstate_cython__(self, __pyx_state):
12606 : */
12607 :
12608 : /* Python wrapper */
12609 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12610 : #if CYTHON_METH_FASTCALL
12611 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12612 : #else
12613 : PyObject *__pyx_args, PyObject *__pyx_kwds
12614 : #endif
12615 : ); /*proto*/
12616 0 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
12617 : #if CYTHON_METH_FASTCALL
12618 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12619 : #else
12620 : PyObject *__pyx_args, PyObject *__pyx_kwds
12621 : #endif
12622 : ) {
12623 : #if !CYTHON_METH_FASTCALL
12624 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12625 : #endif
12626 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12627 0 : PyObject *__pyx_r = 0;
12628 : __Pyx_RefNannyDeclarations
12629 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
12630 : #if !CYTHON_METH_FASTCALL
12631 : #if CYTHON_ASSUME_SAFE_MACROS
12632 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12633 : #else
12634 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12635 : #endif
12636 : #endif
12637 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12638 0 : if (unlikely(__pyx_nargs > 0)) {
12639 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
12640 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
12641 0 : __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12642 :
12643 : /* function exit code */
12644 0 : __Pyx_RefNannyFinishContext();
12645 0 : return __pyx_r;
12646 : }
12647 :
12648 0 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
12649 0 : PyObject *__pyx_r = NULL;
12650 : __Pyx_RefNannyDeclarations
12651 0 : int __pyx_lineno = 0;
12652 0 : const char *__pyx_filename = NULL;
12653 0 : int __pyx_clineno = 0;
12654 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
12655 :
12656 : /* "(tree fragment)":2
12657 : * def __reduce_cython__(self):
12658 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12659 : * def __setstate_cython__(self, __pyx_state):
12660 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12661 : */
12662 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
12663 0 : __PYX_ERR(1, 2, __pyx_L1_error)
12664 :
12665 : /* "(tree fragment)":1
12666 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
12667 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12668 : * def __setstate_cython__(self, __pyx_state):
12669 : */
12670 :
12671 : /* function exit code */
12672 0 : __pyx_L1_error:;
12673 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12674 0 : __pyx_r = NULL;
12675 0 : __Pyx_XGIVEREF(__pyx_r);
12676 0 : __Pyx_RefNannyFinishContext();
12677 0 : return __pyx_r;
12678 : }
12679 :
12680 : /* "(tree fragment)":3
12681 : * def __reduce_cython__(self):
12682 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12683 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12684 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12685 : */
12686 :
12687 : /* Python wrapper */
12688 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12689 : #if CYTHON_METH_FASTCALL
12690 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12691 : #else
12692 : PyObject *__pyx_args, PyObject *__pyx_kwds
12693 : #endif
12694 : ); /*proto*/
12695 0 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
12696 : #if CYTHON_METH_FASTCALL
12697 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
12698 : #else
12699 : PyObject *__pyx_args, PyObject *__pyx_kwds
12700 : #endif
12701 : ) {
12702 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
12703 : #if !CYTHON_METH_FASTCALL
12704 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
12705 : #endif
12706 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
12707 0 : PyObject* values[1] = {0};
12708 0 : int __pyx_lineno = 0;
12709 0 : const char *__pyx_filename = NULL;
12710 0 : int __pyx_clineno = 0;
12711 0 : PyObject *__pyx_r = 0;
12712 : __Pyx_RefNannyDeclarations
12713 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
12714 : #if !CYTHON_METH_FASTCALL
12715 : #if CYTHON_ASSUME_SAFE_MACROS
12716 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
12717 : #else
12718 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
12719 : #endif
12720 : #endif
12721 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
12722 0 : {
12723 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
12724 0 : if (__pyx_kwds) {
12725 0 : Py_ssize_t kw_args;
12726 0 : switch (__pyx_nargs) {
12727 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
12728 0 : CYTHON_FALLTHROUGH;
12729 0 : case 0: break;
12730 0 : default: goto __pyx_L5_argtuple_error;
12731 : }
12732 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
12733 0 : switch (__pyx_nargs) {
12734 0 : case 0:
12735 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
12736 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
12737 0 : kw_args--;
12738 : }
12739 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
12740 0 : else goto __pyx_L5_argtuple_error;
12741 : }
12742 0 : if (unlikely(kw_args > 0)) {
12743 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
12744 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
12745 : }
12746 0 : } else if (unlikely(__pyx_nargs != 1)) {
12747 0 : goto __pyx_L5_argtuple_error;
12748 : } else {
12749 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
12750 : }
12751 0 : __pyx_v___pyx_state = values[0];
12752 : }
12753 0 : goto __pyx_L6_skip;
12754 0 : __pyx_L5_argtuple_error:;
12755 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
12756 0 : __pyx_L6_skip:;
12757 0 : goto __pyx_L4_argument_unpacking_done;
12758 0 : __pyx_L3_error:;
12759 0 : {
12760 0 : Py_ssize_t __pyx_temp;
12761 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12762 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
12763 : }
12764 : }
12765 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12766 : __Pyx_RefNannyFinishContext();
12767 : return NULL;
12768 0 : __pyx_L4_argument_unpacking_done:;
12769 0 : __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
12770 :
12771 : /* function exit code */
12772 : {
12773 : Py_ssize_t __pyx_temp;
12774 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
12775 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
12776 : }
12777 : }
12778 : __Pyx_RefNannyFinishContext();
12779 : return __pyx_r;
12780 : }
12781 :
12782 0 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
12783 0 : PyObject *__pyx_r = NULL;
12784 : __Pyx_RefNannyDeclarations
12785 0 : int __pyx_lineno = 0;
12786 0 : const char *__pyx_filename = NULL;
12787 0 : int __pyx_clineno = 0;
12788 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
12789 :
12790 : /* "(tree fragment)":4
12791 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12792 : * def __setstate_cython__(self, __pyx_state):
12793 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
12794 : */
12795 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
12796 0 : __PYX_ERR(1, 4, __pyx_L1_error)
12797 :
12798 : /* "(tree fragment)":3
12799 : * def __reduce_cython__(self):
12800 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12801 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
12802 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
12803 : */
12804 :
12805 : /* function exit code */
12806 0 : __pyx_L1_error:;
12807 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12808 0 : __pyx_r = NULL;
12809 0 : __Pyx_XGIVEREF(__pyx_r);
12810 0 : __Pyx_RefNannyFinishContext();
12811 0 : return __pyx_r;
12812 : }
12813 :
12814 : /* "View.MemoryView":662
12815 : *
12816 : * @cname('__pyx_memoryview_new')
12817 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12818 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12819 : * result.typeinfo = typeinfo
12820 : */
12821 :
12822 75718 : static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
12823 75718 : struct __pyx_memoryview_obj *__pyx_v_result = 0;
12824 75718 : PyObject *__pyx_r = NULL;
12825 : __Pyx_RefNannyDeclarations
12826 75718 : PyObject *__pyx_t_1 = NULL;
12827 75718 : PyObject *__pyx_t_2 = NULL;
12828 75718 : PyObject *__pyx_t_3 = NULL;
12829 75718 : int __pyx_lineno = 0;
12830 75718 : const char *__pyx_filename = NULL;
12831 75718 : int __pyx_clineno = 0;
12832 75718 : __Pyx_RefNannySetupContext("memoryview_cwrapper", 1);
12833 :
12834 : /* "View.MemoryView":663
12835 : * @cname('__pyx_memoryview_new')
12836 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12837 : * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
12838 : * result.typeinfo = typeinfo
12839 : * return result
12840 : */
12841 75718 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
12842 75718 : __Pyx_GOTREF(__pyx_t_1);
12843 75718 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
12844 75718 : __Pyx_GOTREF(__pyx_t_2);
12845 75718 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
12846 75718 : __Pyx_GOTREF(__pyx_t_3);
12847 75718 : __Pyx_INCREF(__pyx_v_o);
12848 75718 : __Pyx_GIVEREF(__pyx_v_o);
12849 75718 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(1, 663, __pyx_L1_error);
12850 75718 : __Pyx_GIVEREF(__pyx_t_1);
12851 75718 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error);
12852 75718 : __Pyx_GIVEREF(__pyx_t_2);
12853 75718 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error);
12854 75718 : __pyx_t_1 = 0;
12855 75718 : __pyx_t_2 = 0;
12856 75718 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
12857 75718 : __Pyx_GOTREF(__pyx_t_2);
12858 75718 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12859 75718 : __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
12860 75718 : __pyx_t_2 = 0;
12861 :
12862 : /* "View.MemoryView":664
12863 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
12864 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12865 : * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
12866 : * return result
12867 : *
12868 : */
12869 75718 : __pyx_v_result->typeinfo = __pyx_v_typeinfo;
12870 :
12871 : /* "View.MemoryView":665
12872 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12873 : * result.typeinfo = typeinfo
12874 : * return result # <<<<<<<<<<<<<<
12875 : *
12876 : * @cname('__pyx_memoryview_check')
12877 : */
12878 75718 : __Pyx_XDECREF(__pyx_r);
12879 75718 : __Pyx_INCREF((PyObject *)__pyx_v_result);
12880 75718 : __pyx_r = ((PyObject *)__pyx_v_result);
12881 75718 : goto __pyx_L0;
12882 :
12883 : /* "View.MemoryView":662
12884 : *
12885 : * @cname('__pyx_memoryview_new')
12886 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
12887 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
12888 : * result.typeinfo = typeinfo
12889 : */
12890 :
12891 : /* function exit code */
12892 0 : __pyx_L1_error:;
12893 0 : __Pyx_XDECREF(__pyx_t_1);
12894 0 : __Pyx_XDECREF(__pyx_t_2);
12895 0 : __Pyx_XDECREF(__pyx_t_3);
12896 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
12897 0 : __pyx_r = 0;
12898 75718 : __pyx_L0:;
12899 75718 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
12900 75718 : __Pyx_XGIVEREF(__pyx_r);
12901 75718 : __Pyx_RefNannyFinishContext();
12902 75718 : return __pyx_r;
12903 : }
12904 :
12905 : /* "View.MemoryView":668
12906 : *
12907 : * @cname('__pyx_memoryview_check')
12908 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12909 : * return isinstance(o, memoryview)
12910 : *
12911 : */
12912 :
12913 75718 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
12914 75718 : int __pyx_r;
12915 75718 : int __pyx_t_1;
12916 :
12917 : /* "View.MemoryView":669
12918 : * @cname('__pyx_memoryview_check')
12919 : * cdef inline bint memoryview_check(object o) noexcept:
12920 : * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
12921 : *
12922 : * cdef tuple _unellipsify(object index, int ndim):
12923 : */
12924 75718 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12925 75718 : __pyx_r = __pyx_t_1;
12926 75718 : goto __pyx_L0;
12927 :
12928 : /* "View.MemoryView":668
12929 : *
12930 : * @cname('__pyx_memoryview_check')
12931 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12932 : * return isinstance(o, memoryview)
12933 : *
12934 : */
12935 :
12936 : /* function exit code */
12937 75718 : __pyx_L0:;
12938 75718 : return __pyx_r;
12939 : }
12940 :
12941 : /* "View.MemoryView":671
12942 : * return isinstance(o, memoryview)
12943 : *
12944 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12945 : * """
12946 : * Replace all ellipses with full slices and fill incomplete indices with
12947 : */
12948 :
12949 2834 : static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12950 2834 : Py_ssize_t __pyx_v_idx;
12951 2834 : PyObject *__pyx_v_tup = NULL;
12952 2834 : PyObject *__pyx_v_result = NULL;
12953 2834 : int __pyx_v_have_slices;
12954 2834 : int __pyx_v_seen_ellipsis;
12955 2834 : PyObject *__pyx_v_item = NULL;
12956 2834 : Py_ssize_t __pyx_v_nslices;
12957 2834 : PyObject *__pyx_r = NULL;
12958 : __Pyx_RefNannyDeclarations
12959 2834 : PyObject *__pyx_t_1 = NULL;
12960 2834 : int __pyx_t_2;
12961 2834 : PyObject *__pyx_t_3 = NULL;
12962 2834 : Py_ssize_t __pyx_t_4;
12963 2834 : Py_ssize_t __pyx_t_5;
12964 2834 : Py_UCS4 __pyx_t_6;
12965 2834 : PyObject *__pyx_t_7 = NULL;
12966 2834 : int __pyx_lineno = 0;
12967 2834 : const char *__pyx_filename = NULL;
12968 2834 : int __pyx_clineno = 0;
12969 2834 : __Pyx_RefNannySetupContext("_unellipsify", 1);
12970 :
12971 : /* "View.MemoryView":677
12972 : * """
12973 : * cdef Py_ssize_t idx
12974 : * tup = <tuple>index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
12975 : *
12976 : * result = [slice(None)] * ndim
12977 : */
12978 2834 : __pyx_t_2 = PyTuple_Check(__pyx_v_index);
12979 2834 : if (__pyx_t_2) {
12980 0 : __Pyx_INCREF(((PyObject*)__pyx_v_index));
12981 : __pyx_t_1 = __pyx_v_index;
12982 : } else {
12983 2834 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
12984 2834 : __Pyx_GOTREF(__pyx_t_3);
12985 2834 : __Pyx_INCREF(__pyx_v_index);
12986 2834 : __Pyx_GIVEREF(__pyx_v_index);
12987 2834 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(1, 677, __pyx_L1_error);
12988 2834 : __pyx_t_1 = __pyx_t_3;
12989 2834 : __pyx_t_3 = 0;
12990 : }
12991 2834 : __pyx_v_tup = ((PyObject*)__pyx_t_1);
12992 2834 : __pyx_t_1 = 0;
12993 :
12994 : /* "View.MemoryView":679
12995 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
12996 : *
12997 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12998 : * have_slices = False
12999 : * seen_ellipsis = False
13000 : */
13001 2834 : __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
13002 : __Pyx_GOTREF(__pyx_t_1);
13003 : { Py_ssize_t __pyx_temp;
13004 5668 : for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
13005 2834 : __Pyx_INCREF(__pyx_slice__5);
13006 2834 : __Pyx_GIVEREF(__pyx_slice__5);
13007 2834 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error);
13008 : }
13009 : }
13010 2834 : __pyx_v_result = ((PyObject*)__pyx_t_1);
13011 2834 : __pyx_t_1 = 0;
13012 :
13013 : /* "View.MemoryView":680
13014 : *
13015 : * result = [slice(None)] * ndim
13016 : * have_slices = False # <<<<<<<<<<<<<<
13017 : * seen_ellipsis = False
13018 : * idx = 0
13019 : */
13020 2834 : __pyx_v_have_slices = 0;
13021 :
13022 : /* "View.MemoryView":681
13023 : * result = [slice(None)] * ndim
13024 : * have_slices = False
13025 : * seen_ellipsis = False # <<<<<<<<<<<<<<
13026 : * idx = 0
13027 : * for item in tup:
13028 : */
13029 2834 : __pyx_v_seen_ellipsis = 0;
13030 :
13031 : /* "View.MemoryView":682
13032 : * have_slices = False
13033 : * seen_ellipsis = False
13034 : * idx = 0 # <<<<<<<<<<<<<<
13035 : * for item in tup:
13036 : * if item is Ellipsis:
13037 : */
13038 2834 : __pyx_v_idx = 0;
13039 :
13040 : /* "View.MemoryView":683
13041 : * seen_ellipsis = False
13042 : * idx = 0
13043 : * for item in tup: # <<<<<<<<<<<<<<
13044 : * if item is Ellipsis:
13045 : * if not seen_ellipsis:
13046 : */
13047 2834 : if (unlikely(__pyx_v_tup == Py_None)) {
13048 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
13049 0 : __PYX_ERR(1, 683, __pyx_L1_error)
13050 : }
13051 2834 : __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
13052 : __pyx_t_4 = 0;
13053 8502 : for (;;) {
13054 5668 : {
13055 5668 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
13056 : #if !CYTHON_ASSUME_SAFE_MACROS
13057 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
13058 : #endif
13059 5668 : if (__pyx_t_4 >= __pyx_temp) break;
13060 : }
13061 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13062 2834 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
13063 : #else
13064 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
13065 : __Pyx_GOTREF(__pyx_t_3);
13066 : #endif
13067 2834 : __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
13068 2834 : __pyx_t_3 = 0;
13069 :
13070 : /* "View.MemoryView":684
13071 : * idx = 0
13072 : * for item in tup:
13073 : * if item is Ellipsis: # <<<<<<<<<<<<<<
13074 : * if not seen_ellipsis:
13075 : * idx += ndim - len(tup)
13076 : */
13077 2834 : __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
13078 2834 : if (__pyx_t_2) {
13079 :
13080 : /* "View.MemoryView":685
13081 : * for item in tup:
13082 : * if item is Ellipsis:
13083 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
13084 : * idx += ndim - len(tup)
13085 : * seen_ellipsis = True
13086 : */
13087 0 : __pyx_t_2 = (!__pyx_v_seen_ellipsis);
13088 0 : if (__pyx_t_2) {
13089 :
13090 : /* "View.MemoryView":686
13091 : * if item is Ellipsis:
13092 : * if not seen_ellipsis:
13093 : * idx += ndim - len(tup) # <<<<<<<<<<<<<<
13094 : * seen_ellipsis = True
13095 : * have_slices = True
13096 : */
13097 0 : if (unlikely(__pyx_v_tup == Py_None)) {
13098 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
13099 : __PYX_ERR(1, 686, __pyx_L1_error)
13100 : }
13101 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
13102 0 : __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
13103 :
13104 : /* "View.MemoryView":687
13105 : * if not seen_ellipsis:
13106 : * idx += ndim - len(tup)
13107 : * seen_ellipsis = True # <<<<<<<<<<<<<<
13108 : * have_slices = True
13109 : * else:
13110 : */
13111 0 : __pyx_v_seen_ellipsis = 1;
13112 :
13113 : /* "View.MemoryView":685
13114 : * for item in tup:
13115 : * if item is Ellipsis:
13116 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
13117 : * idx += ndim - len(tup)
13118 : * seen_ellipsis = True
13119 : */
13120 : }
13121 :
13122 : /* "View.MemoryView":688
13123 : * idx += ndim - len(tup)
13124 : * seen_ellipsis = True
13125 : * have_slices = True # <<<<<<<<<<<<<<
13126 : * else:
13127 : * if isinstance(item, slice):
13128 : */
13129 0 : __pyx_v_have_slices = 1;
13130 :
13131 : /* "View.MemoryView":684
13132 : * idx = 0
13133 : * for item in tup:
13134 : * if item is Ellipsis: # <<<<<<<<<<<<<<
13135 : * if not seen_ellipsis:
13136 : * idx += ndim - len(tup)
13137 : */
13138 0 : goto __pyx_L5;
13139 : }
13140 :
13141 : /* "View.MemoryView":690
13142 : * have_slices = True
13143 : * else:
13144 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
13145 : * have_slices = True
13146 : * elif not PyIndex_Check(item):
13147 : */
13148 2834 : /*else*/ {
13149 2834 : __pyx_t_2 = PySlice_Check(__pyx_v_item);
13150 2834 : if (__pyx_t_2) {
13151 :
13152 : /* "View.MemoryView":691
13153 : * else:
13154 : * if isinstance(item, slice):
13155 : * have_slices = True # <<<<<<<<<<<<<<
13156 : * elif not PyIndex_Check(item):
13157 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13158 : */
13159 0 : __pyx_v_have_slices = 1;
13160 :
13161 : /* "View.MemoryView":690
13162 : * have_slices = True
13163 : * else:
13164 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
13165 : * have_slices = True
13166 : * elif not PyIndex_Check(item):
13167 : */
13168 0 : goto __pyx_L7;
13169 : }
13170 :
13171 : /* "View.MemoryView":692
13172 : * if isinstance(item, slice):
13173 : * have_slices = True
13174 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
13175 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13176 : * result[idx] = item
13177 : */
13178 2834 : __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
13179 2834 : if (unlikely(__pyx_t_2)) {
13180 :
13181 : /* "View.MemoryView":693
13182 : * have_slices = True
13183 : * elif not PyIndex_Check(item):
13184 : * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
13185 : * result[idx] = item
13186 : * idx += 1
13187 : */
13188 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
13189 0 : __Pyx_GOTREF(__pyx_t_3);
13190 0 : __pyx_t_5 = 0;
13191 0 : __pyx_t_6 = 127;
13192 0 : __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
13193 0 : __pyx_t_5 += 24;
13194 0 : __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
13195 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
13196 0 : __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
13197 0 : __Pyx_GOTREF(__pyx_t_7);
13198 0 : __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
13199 0 : __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
13200 0 : __Pyx_GIVEREF(__pyx_t_7);
13201 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
13202 0 : __pyx_t_7 = 0;
13203 0 : __Pyx_INCREF(__pyx_kp_u__6);
13204 0 : __pyx_t_5 += 1;
13205 0 : __Pyx_GIVEREF(__pyx_kp_u__6);
13206 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6);
13207 0 : __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
13208 0 : __Pyx_GOTREF(__pyx_t_7);
13209 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13210 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
13211 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13212 0 : __PYX_ERR(1, 693, __pyx_L1_error)
13213 :
13214 : /* "View.MemoryView":692
13215 : * if isinstance(item, slice):
13216 : * have_slices = True
13217 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
13218 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13219 : * result[idx] = item
13220 : */
13221 : }
13222 2834 : __pyx_L7:;
13223 :
13224 : /* "View.MemoryView":694
13225 : * elif not PyIndex_Check(item):
13226 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13227 : * result[idx] = item # <<<<<<<<<<<<<<
13228 : * idx += 1
13229 : *
13230 : */
13231 2834 : if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
13232 : }
13233 2834 : __pyx_L5:;
13234 :
13235 : /* "View.MemoryView":695
13236 : * raise TypeError, f"Cannot index with type '{type(item)}'"
13237 : * result[idx] = item
13238 : * idx += 1 # <<<<<<<<<<<<<<
13239 : *
13240 : * nslices = ndim - idx
13241 : */
13242 2834 : __pyx_v_idx = (__pyx_v_idx + 1);
13243 :
13244 : /* "View.MemoryView":683
13245 : * seen_ellipsis = False
13246 : * idx = 0
13247 : * for item in tup: # <<<<<<<<<<<<<<
13248 : * if item is Ellipsis:
13249 : * if not seen_ellipsis:
13250 : */
13251 2834 : }
13252 2834 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13253 :
13254 : /* "View.MemoryView":697
13255 : * idx += 1
13256 : *
13257 : * nslices = ndim - idx # <<<<<<<<<<<<<<
13258 : * return have_slices or nslices, tuple(result)
13259 : *
13260 : */
13261 2834 : __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
13262 :
13263 : /* "View.MemoryView":698
13264 : *
13265 : * nslices = ndim - idx
13266 : * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
13267 : *
13268 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13269 : */
13270 2834 : __Pyx_XDECREF(__pyx_r);
13271 2834 : if (!__pyx_v_have_slices) {
13272 : } else {
13273 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13274 0 : __Pyx_GOTREF(__pyx_t_7);
13275 0 : __pyx_t_1 = __pyx_t_7;
13276 0 : __pyx_t_7 = 0;
13277 0 : goto __pyx_L9_bool_binop_done;
13278 : }
13279 2834 : __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13280 : __Pyx_GOTREF(__pyx_t_7);
13281 : __pyx_t_1 = __pyx_t_7;
13282 2834 : __pyx_t_7 = 0;
13283 2834 : __pyx_L9_bool_binop_done:;
13284 2834 : __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
13285 2834 : __Pyx_GOTREF(__pyx_t_7);
13286 2834 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
13287 2834 : __Pyx_GOTREF(__pyx_t_3);
13288 2834 : __Pyx_GIVEREF(__pyx_t_1);
13289 2834 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 698, __pyx_L1_error);
13290 2834 : __Pyx_GIVEREF(__pyx_t_7);
13291 2834 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error);
13292 2834 : __pyx_t_1 = 0;
13293 2834 : __pyx_t_7 = 0;
13294 2834 : __pyx_r = ((PyObject*)__pyx_t_3);
13295 2834 : __pyx_t_3 = 0;
13296 2834 : goto __pyx_L0;
13297 :
13298 : /* "View.MemoryView":671
13299 : * return isinstance(o, memoryview)
13300 : *
13301 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13302 : * """
13303 : * Replace all ellipses with full slices and fill incomplete indices with
13304 : */
13305 :
13306 : /* function exit code */
13307 0 : __pyx_L1_error:;
13308 0 : __Pyx_XDECREF(__pyx_t_1);
13309 0 : __Pyx_XDECREF(__pyx_t_3);
13310 0 : __Pyx_XDECREF(__pyx_t_7);
13311 0 : __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
13312 0 : __pyx_r = 0;
13313 2834 : __pyx_L0:;
13314 2834 : __Pyx_XDECREF(__pyx_v_tup);
13315 2834 : __Pyx_XDECREF(__pyx_v_result);
13316 2834 : __Pyx_XDECREF(__pyx_v_item);
13317 2834 : __Pyx_XGIVEREF(__pyx_r);
13318 2834 : __Pyx_RefNannyFinishContext();
13319 2834 : return __pyx_r;
13320 : }
13321 :
13322 : /* "View.MemoryView":700
13323 : * return have_slices or nslices, tuple(result)
13324 : *
13325 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13326 : * for suboffset in suboffsets[:ndim]:
13327 : * if suboffset >= 0:
13328 : */
13329 :
13330 0 : static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
13331 0 : Py_ssize_t __pyx_v_suboffset;
13332 0 : int __pyx_r;
13333 0 : Py_ssize_t *__pyx_t_1;
13334 0 : Py_ssize_t *__pyx_t_2;
13335 0 : Py_ssize_t *__pyx_t_3;
13336 0 : int __pyx_t_4;
13337 0 : int __pyx_lineno = 0;
13338 0 : const char *__pyx_filename = NULL;
13339 0 : int __pyx_clineno = 0;
13340 :
13341 : /* "View.MemoryView":701
13342 : *
13343 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13344 : * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
13345 : * if suboffset >= 0:
13346 : * raise ValueError, "Indirect dimensions not supported"
13347 : */
13348 0 : __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
13349 0 : for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
13350 0 : __pyx_t_1 = __pyx_t_3;
13351 0 : __pyx_v_suboffset = (__pyx_t_1[0]);
13352 :
13353 : /* "View.MemoryView":702
13354 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13355 : * for suboffset in suboffsets[:ndim]:
13356 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13357 : * raise ValueError, "Indirect dimensions not supported"
13358 : * return 0 # return type just used as an error flag
13359 : */
13360 0 : __pyx_t_4 = (__pyx_v_suboffset >= 0);
13361 0 : if (unlikely(__pyx_t_4)) {
13362 :
13363 : /* "View.MemoryView":703
13364 : * for suboffset in suboffsets[:ndim]:
13365 : * if suboffset >= 0:
13366 : * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
13367 : * return 0 # return type just used as an error flag
13368 : *
13369 : */
13370 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
13371 0 : __PYX_ERR(1, 703, __pyx_L1_error)
13372 :
13373 : /* "View.MemoryView":702
13374 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
13375 : * for suboffset in suboffsets[:ndim]:
13376 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13377 : * raise ValueError, "Indirect dimensions not supported"
13378 : * return 0 # return type just used as an error flag
13379 : */
13380 : }
13381 : }
13382 :
13383 : /* "View.MemoryView":704
13384 : * if suboffset >= 0:
13385 : * raise ValueError, "Indirect dimensions not supported"
13386 : * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
13387 : *
13388 : *
13389 : */
13390 0 : __pyx_r = 0;
13391 0 : goto __pyx_L0;
13392 :
13393 : /* "View.MemoryView":700
13394 : * return have_slices or nslices, tuple(result)
13395 : *
13396 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
13397 : * for suboffset in suboffsets[:ndim]:
13398 : * if suboffset >= 0:
13399 : */
13400 :
13401 : /* function exit code */
13402 0 : __pyx_L1_error:;
13403 0 : __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
13404 0 : __pyx_r = -1;
13405 0 : __pyx_L0:;
13406 0 : return __pyx_r;
13407 : }
13408 :
13409 : /* "View.MemoryView":711
13410 : *
13411 : * @cname('__pyx_memview_slice')
13412 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13413 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
13414 : * cdef bint negative_step
13415 : */
13416 :
13417 0 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
13418 0 : int __pyx_v_new_ndim;
13419 0 : int __pyx_v_suboffset_dim;
13420 0 : int __pyx_v_dim;
13421 0 : __Pyx_memviewslice __pyx_v_src;
13422 0 : __Pyx_memviewslice __pyx_v_dst;
13423 0 : __Pyx_memviewslice *__pyx_v_p_src;
13424 0 : struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
13425 0 : __Pyx_memviewslice *__pyx_v_p_dst;
13426 0 : int *__pyx_v_p_suboffset_dim;
13427 0 : Py_ssize_t __pyx_v_start;
13428 0 : Py_ssize_t __pyx_v_stop;
13429 0 : Py_ssize_t __pyx_v_step;
13430 0 : Py_ssize_t __pyx_v_cindex;
13431 0 : int __pyx_v_have_start;
13432 0 : int __pyx_v_have_stop;
13433 0 : int __pyx_v_have_step;
13434 0 : PyObject *__pyx_v_index = NULL;
13435 0 : struct __pyx_memoryview_obj *__pyx_r = NULL;
13436 : __Pyx_RefNannyDeclarations
13437 0 : int __pyx_t_1;
13438 0 : PyObject *__pyx_t_2 = NULL;
13439 0 : struct __pyx_memoryview_obj *__pyx_t_3;
13440 0 : char *__pyx_t_4;
13441 0 : int __pyx_t_5;
13442 0 : Py_ssize_t __pyx_t_6;
13443 0 : PyObject *(*__pyx_t_7)(PyObject *);
13444 0 : PyObject *__pyx_t_8 = NULL;
13445 0 : Py_ssize_t __pyx_t_9;
13446 0 : int __pyx_t_10;
13447 0 : Py_ssize_t __pyx_t_11;
13448 0 : int __pyx_lineno = 0;
13449 0 : const char *__pyx_filename = NULL;
13450 0 : int __pyx_clineno = 0;
13451 0 : __Pyx_RefNannySetupContext("memview_slice", 1);
13452 :
13453 : /* "View.MemoryView":712
13454 : * @cname('__pyx_memview_slice')
13455 : * cdef memoryview memview_slice(memoryview memview, object indices):
13456 : * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
13457 : * cdef bint negative_step
13458 : * cdef __Pyx_memviewslice src, dst
13459 : */
13460 0 : __pyx_v_new_ndim = 0;
13461 0 : __pyx_v_suboffset_dim = -1;
13462 :
13463 : /* "View.MemoryView":719
13464 : *
13465 : *
13466 : * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
13467 : *
13468 : * cdef _memoryviewslice memviewsliceobj
13469 : */
13470 0 : (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
13471 :
13472 : /* "View.MemoryView":723
13473 : * cdef _memoryviewslice memviewsliceobj
13474 : *
13475 : * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
13476 : *
13477 : * if isinstance(memview, _memoryviewslice):
13478 : */
13479 : #ifndef CYTHON_WITHOUT_ASSERTIONS
13480 0 : if (unlikely(__pyx_assertions_enabled())) {
13481 0 : __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
13482 0 : if (unlikely(!__pyx_t_1)) {
13483 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
13484 0 : __PYX_ERR(1, 723, __pyx_L1_error)
13485 : }
13486 : }
13487 : #else
13488 : if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
13489 : #endif
13490 :
13491 : /* "View.MemoryView":725
13492 : * assert memview.view.ndim > 0
13493 : *
13494 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13495 : * memviewsliceobj = memview
13496 : * p_src = &memviewsliceobj.from_slice
13497 : */
13498 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13499 0 : if (__pyx_t_1) {
13500 :
13501 : /* "View.MemoryView":726
13502 : *
13503 : * if isinstance(memview, _memoryviewslice):
13504 : * memviewsliceobj = memview # <<<<<<<<<<<<<<
13505 : * p_src = &memviewsliceobj.from_slice
13506 : * else:
13507 : */
13508 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
13509 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
13510 0 : __Pyx_INCREF(__pyx_t_2);
13511 0 : __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
13512 0 : __pyx_t_2 = 0;
13513 :
13514 : /* "View.MemoryView":727
13515 : * if isinstance(memview, _memoryviewslice):
13516 : * memviewsliceobj = memview
13517 : * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
13518 : * else:
13519 : * slice_copy(memview, &src)
13520 : */
13521 0 : __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
13522 :
13523 : /* "View.MemoryView":725
13524 : * assert memview.view.ndim > 0
13525 : *
13526 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13527 : * memviewsliceobj = memview
13528 : * p_src = &memviewsliceobj.from_slice
13529 : */
13530 0 : goto __pyx_L3;
13531 : }
13532 :
13533 : /* "View.MemoryView":729
13534 : * p_src = &memviewsliceobj.from_slice
13535 : * else:
13536 : * slice_copy(memview, &src) # <<<<<<<<<<<<<<
13537 : * p_src = &src
13538 : *
13539 : */
13540 0 : /*else*/ {
13541 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
13542 :
13543 : /* "View.MemoryView":730
13544 : * else:
13545 : * slice_copy(memview, &src)
13546 : * p_src = &src # <<<<<<<<<<<<<<
13547 : *
13548 : *
13549 : */
13550 0 : __pyx_v_p_src = (&__pyx_v_src);
13551 : }
13552 0 : __pyx_L3:;
13553 :
13554 : /* "View.MemoryView":736
13555 : *
13556 : *
13557 : * dst.memview = p_src.memview # <<<<<<<<<<<<<<
13558 : * dst.data = p_src.data
13559 : *
13560 : */
13561 0 : __pyx_t_3 = __pyx_v_p_src->memview;
13562 0 : __pyx_v_dst.memview = __pyx_t_3;
13563 :
13564 : /* "View.MemoryView":737
13565 : *
13566 : * dst.memview = p_src.memview
13567 : * dst.data = p_src.data # <<<<<<<<<<<<<<
13568 : *
13569 : *
13570 : */
13571 0 : __pyx_t_4 = __pyx_v_p_src->data;
13572 0 : __pyx_v_dst.data = __pyx_t_4;
13573 :
13574 : /* "View.MemoryView":742
13575 : *
13576 : *
13577 : * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
13578 : * cdef int *p_suboffset_dim = &suboffset_dim
13579 : * cdef Py_ssize_t start, stop, step, cindex
13580 : */
13581 0 : __pyx_v_p_dst = (&__pyx_v_dst);
13582 :
13583 : /* "View.MemoryView":743
13584 : *
13585 : * cdef __Pyx_memviewslice *p_dst = &dst
13586 : * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
13587 : * cdef Py_ssize_t start, stop, step, cindex
13588 : * cdef bint have_start, have_stop, have_step
13589 : */
13590 0 : __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
13591 :
13592 : /* "View.MemoryView":747
13593 : * cdef bint have_start, have_stop, have_step
13594 : *
13595 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13596 : * if PyIndex_Check(index):
13597 : * cindex = index
13598 : */
13599 0 : __pyx_t_5 = 0;
13600 0 : if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
13601 0 : __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
13602 0 : __pyx_t_6 = 0;
13603 0 : __pyx_t_7 = NULL;
13604 : } else {
13605 0 : __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
13606 0 : __Pyx_GOTREF(__pyx_t_2);
13607 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
13608 : }
13609 0 : for (;;) {
13610 0 : if (likely(!__pyx_t_7)) {
13611 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
13612 0 : {
13613 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
13614 : #if !CYTHON_ASSUME_SAFE_MACROS
13615 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
13616 : #endif
13617 0 : if (__pyx_t_6 >= __pyx_temp) break;
13618 : }
13619 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13620 0 : __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
13621 : #else
13622 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
13623 : __Pyx_GOTREF(__pyx_t_8);
13624 : #endif
13625 : } else {
13626 0 : {
13627 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
13628 : #if !CYTHON_ASSUME_SAFE_MACROS
13629 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
13630 : #endif
13631 0 : if (__pyx_t_6 >= __pyx_temp) break;
13632 : }
13633 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
13634 0 : __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
13635 : #else
13636 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
13637 : __Pyx_GOTREF(__pyx_t_8);
13638 : #endif
13639 : }
13640 : } else {
13641 0 : __pyx_t_8 = __pyx_t_7(__pyx_t_2);
13642 0 : if (unlikely(!__pyx_t_8)) {
13643 0 : PyObject* exc_type = PyErr_Occurred();
13644 0 : if (exc_type) {
13645 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
13646 0 : else __PYX_ERR(1, 747, __pyx_L1_error)
13647 : }
13648 : break;
13649 : }
13650 0 : __Pyx_GOTREF(__pyx_t_8);
13651 : }
13652 0 : __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
13653 0 : __pyx_t_8 = 0;
13654 0 : __pyx_v_dim = __pyx_t_5;
13655 0 : __pyx_t_5 = (__pyx_t_5 + 1);
13656 :
13657 : /* "View.MemoryView":748
13658 : *
13659 : * for dim, index in enumerate(indices):
13660 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13661 : * cindex = index
13662 : * slice_memviewslice(
13663 : */
13664 0 : __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
13665 0 : if (__pyx_t_1) {
13666 :
13667 : /* "View.MemoryView":749
13668 : * for dim, index in enumerate(indices):
13669 : * if PyIndex_Check(index):
13670 : * cindex = index # <<<<<<<<<<<<<<
13671 : * slice_memviewslice(
13672 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13673 : */
13674 0 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
13675 0 : __pyx_v_cindex = __pyx_t_9;
13676 :
13677 : /* "View.MemoryView":750
13678 : * if PyIndex_Check(index):
13679 : * cindex = index
13680 : * slice_memviewslice( # <<<<<<<<<<<<<<
13681 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13682 : * dim, new_ndim, p_suboffset_dim,
13683 : */
13684 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
13685 :
13686 : /* "View.MemoryView":748
13687 : *
13688 : * for dim, index in enumerate(indices):
13689 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
13690 : * cindex = index
13691 : * slice_memviewslice(
13692 : */
13693 0 : goto __pyx_L6;
13694 : }
13695 :
13696 : /* "View.MemoryView":756
13697 : * 0, 0, 0, # have_{start,stop,step}
13698 : * False)
13699 : * elif index is None: # <<<<<<<<<<<<<<
13700 : * p_dst.shape[new_ndim] = 1
13701 : * p_dst.strides[new_ndim] = 0
13702 : */
13703 0 : __pyx_t_1 = (__pyx_v_index == Py_None);
13704 0 : if (__pyx_t_1) {
13705 :
13706 : /* "View.MemoryView":757
13707 : * False)
13708 : * elif index is None:
13709 : * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
13710 : * p_dst.strides[new_ndim] = 0
13711 : * p_dst.suboffsets[new_ndim] = -1
13712 : */
13713 0 : (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
13714 :
13715 : /* "View.MemoryView":758
13716 : * elif index is None:
13717 : * p_dst.shape[new_ndim] = 1
13718 : * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
13719 : * p_dst.suboffsets[new_ndim] = -1
13720 : * new_ndim += 1
13721 : */
13722 0 : (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
13723 :
13724 : /* "View.MemoryView":759
13725 : * p_dst.shape[new_ndim] = 1
13726 : * p_dst.strides[new_ndim] = 0
13727 : * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
13728 : * new_ndim += 1
13729 : * else:
13730 : */
13731 0 : (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
13732 :
13733 : /* "View.MemoryView":760
13734 : * p_dst.strides[new_ndim] = 0
13735 : * p_dst.suboffsets[new_ndim] = -1
13736 : * new_ndim += 1 # <<<<<<<<<<<<<<
13737 : * else:
13738 : * start = index.start or 0
13739 : */
13740 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13741 :
13742 : /* "View.MemoryView":756
13743 : * 0, 0, 0, # have_{start,stop,step}
13744 : * False)
13745 : * elif index is None: # <<<<<<<<<<<<<<
13746 : * p_dst.shape[new_ndim] = 1
13747 : * p_dst.strides[new_ndim] = 0
13748 : */
13749 0 : goto __pyx_L6;
13750 : }
13751 :
13752 : /* "View.MemoryView":762
13753 : * new_ndim += 1
13754 : * else:
13755 : * start = index.start or 0 # <<<<<<<<<<<<<<
13756 : * stop = index.stop or 0
13757 : * step = index.step or 0
13758 : */
13759 0 : /*else*/ {
13760 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
13761 0 : __Pyx_GOTREF(__pyx_t_8);
13762 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
13763 0 : if (!__pyx_t_1) {
13764 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13765 : } else {
13766 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
13767 0 : __pyx_t_9 = __pyx_t_11;
13768 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13769 0 : goto __pyx_L7_bool_binop_done;
13770 : }
13771 : __pyx_t_9 = 0;
13772 0 : __pyx_L7_bool_binop_done:;
13773 0 : __pyx_v_start = __pyx_t_9;
13774 :
13775 : /* "View.MemoryView":763
13776 : * else:
13777 : * start = index.start or 0
13778 : * stop = index.stop or 0 # <<<<<<<<<<<<<<
13779 : * step = index.step or 0
13780 : *
13781 : */
13782 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
13783 0 : __Pyx_GOTREF(__pyx_t_8);
13784 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
13785 0 : if (!__pyx_t_1) {
13786 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13787 : } else {
13788 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
13789 0 : __pyx_t_9 = __pyx_t_11;
13790 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13791 0 : goto __pyx_L9_bool_binop_done;
13792 : }
13793 : __pyx_t_9 = 0;
13794 0 : __pyx_L9_bool_binop_done:;
13795 0 : __pyx_v_stop = __pyx_t_9;
13796 :
13797 : /* "View.MemoryView":764
13798 : * start = index.start or 0
13799 : * stop = index.stop or 0
13800 : * step = index.step or 0 # <<<<<<<<<<<<<<
13801 : *
13802 : * have_start = index.start is not None
13803 : */
13804 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
13805 0 : __Pyx_GOTREF(__pyx_t_8);
13806 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
13807 0 : if (!__pyx_t_1) {
13808 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13809 : } else {
13810 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
13811 0 : __pyx_t_9 = __pyx_t_11;
13812 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13813 0 : goto __pyx_L11_bool_binop_done;
13814 : }
13815 : __pyx_t_9 = 0;
13816 0 : __pyx_L11_bool_binop_done:;
13817 0 : __pyx_v_step = __pyx_t_9;
13818 :
13819 : /* "View.MemoryView":766
13820 : * step = index.step or 0
13821 : *
13822 : * have_start = index.start is not None # <<<<<<<<<<<<<<
13823 : * have_stop = index.stop is not None
13824 : * have_step = index.step is not None
13825 : */
13826 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
13827 0 : __Pyx_GOTREF(__pyx_t_8);
13828 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13829 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13830 0 : __pyx_v_have_start = __pyx_t_1;
13831 :
13832 : /* "View.MemoryView":767
13833 : *
13834 : * have_start = index.start is not None
13835 : * have_stop = index.stop is not None # <<<<<<<<<<<<<<
13836 : * have_step = index.step is not None
13837 : *
13838 : */
13839 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
13840 0 : __Pyx_GOTREF(__pyx_t_8);
13841 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13842 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13843 0 : __pyx_v_have_stop = __pyx_t_1;
13844 :
13845 : /* "View.MemoryView":768
13846 : * have_start = index.start is not None
13847 : * have_stop = index.stop is not None
13848 : * have_step = index.step is not None # <<<<<<<<<<<<<<
13849 : *
13850 : * slice_memviewslice(
13851 : */
13852 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
13853 0 : __Pyx_GOTREF(__pyx_t_8);
13854 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
13855 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13856 0 : __pyx_v_have_step = __pyx_t_1;
13857 :
13858 : /* "View.MemoryView":770
13859 : * have_step = index.step is not None
13860 : *
13861 : * slice_memviewslice( # <<<<<<<<<<<<<<
13862 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
13863 : * dim, new_ndim, p_suboffset_dim,
13864 : */
13865 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
13866 :
13867 : /* "View.MemoryView":776
13868 : * have_start, have_stop, have_step,
13869 : * True)
13870 : * new_ndim += 1 # <<<<<<<<<<<<<<
13871 : *
13872 : * if isinstance(memview, _memoryviewslice):
13873 : */
13874 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
13875 : }
13876 0 : __pyx_L6:;
13877 :
13878 : /* "View.MemoryView":747
13879 : * cdef bint have_start, have_stop, have_step
13880 : *
13881 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
13882 : * if PyIndex_Check(index):
13883 : * cindex = index
13884 : */
13885 : }
13886 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13887 :
13888 : /* "View.MemoryView":778
13889 : * new_ndim += 1
13890 : *
13891 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13892 : * return memoryview_fromslice(dst, new_ndim,
13893 : * memviewsliceobj.to_object_func,
13894 : */
13895 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
13896 0 : if (__pyx_t_1) {
13897 :
13898 : /* "View.MemoryView":779
13899 : *
13900 : * if isinstance(memview, _memoryviewslice):
13901 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13902 : * memviewsliceobj.to_object_func,
13903 : * memviewsliceobj.to_dtype_func,
13904 : */
13905 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
13906 :
13907 : /* "View.MemoryView":780
13908 : * if isinstance(memview, _memoryviewslice):
13909 : * return memoryview_fromslice(dst, new_ndim,
13910 : * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
13911 : * memviewsliceobj.to_dtype_func,
13912 : * memview.dtype_is_object)
13913 : */
13914 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
13915 :
13916 : /* "View.MemoryView":781
13917 : * return memoryview_fromslice(dst, new_ndim,
13918 : * memviewsliceobj.to_object_func,
13919 : * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
13920 : * memview.dtype_is_object)
13921 : * else:
13922 : */
13923 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
13924 :
13925 : /* "View.MemoryView":779
13926 : *
13927 : * if isinstance(memview, _memoryviewslice):
13928 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13929 : * memviewsliceobj.to_object_func,
13930 : * memviewsliceobj.to_dtype_func,
13931 : */
13932 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
13933 0 : __Pyx_GOTREF(__pyx_t_2);
13934 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
13935 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13936 0 : __pyx_t_2 = 0;
13937 0 : goto __pyx_L0;
13938 :
13939 : /* "View.MemoryView":778
13940 : * new_ndim += 1
13941 : *
13942 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13943 : * return memoryview_fromslice(dst, new_ndim,
13944 : * memviewsliceobj.to_object_func,
13945 : */
13946 : }
13947 :
13948 : /* "View.MemoryView":784
13949 : * memview.dtype_is_object)
13950 : * else:
13951 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13952 : * memview.dtype_is_object)
13953 : *
13954 : */
13955 0 : /*else*/ {
13956 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
13957 :
13958 : /* "View.MemoryView":785
13959 : * else:
13960 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13961 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
13962 : *
13963 : *
13964 : */
13965 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
13966 0 : __Pyx_GOTREF(__pyx_t_2);
13967 :
13968 : /* "View.MemoryView":784
13969 : * memview.dtype_is_object)
13970 : * else:
13971 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13972 : * memview.dtype_is_object)
13973 : *
13974 : */
13975 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
13976 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13977 0 : __pyx_t_2 = 0;
13978 0 : goto __pyx_L0;
13979 : }
13980 :
13981 : /* "View.MemoryView":711
13982 : *
13983 : * @cname('__pyx_memview_slice')
13984 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13985 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
13986 : * cdef bint negative_step
13987 : */
13988 :
13989 : /* function exit code */
13990 0 : __pyx_L1_error:;
13991 0 : __Pyx_XDECREF(__pyx_t_2);
13992 0 : __Pyx_XDECREF(__pyx_t_8);
13993 0 : __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13994 : __pyx_r = 0;
13995 0 : __pyx_L0:;
13996 0 : __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13997 0 : __Pyx_XDECREF(__pyx_v_index);
13998 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
13999 0 : __Pyx_RefNannyFinishContext();
14000 0 : return __pyx_r;
14001 : }
14002 :
14003 : /* "View.MemoryView":793
14004 : *
14005 : * @cname('__pyx_memoryview_slice_memviewslice')
14006 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14007 : * __Pyx_memviewslice *dst,
14008 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14009 : */
14010 :
14011 9855594 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
14012 9855594 : Py_ssize_t __pyx_v_new_shape;
14013 9855594 : int __pyx_v_negative_step;
14014 9855594 : int __pyx_r;
14015 9855594 : int __pyx_t_1;
14016 9855594 : int __pyx_t_2;
14017 9855594 : int __pyx_t_3;
14018 9855594 : int __pyx_lineno = 0;
14019 9855594 : const char *__pyx_filename = NULL;
14020 9855594 : int __pyx_clineno = 0;
14021 : #ifdef WITH_THREAD
14022 9855594 : PyGILState_STATE __pyx_gilstate_save;
14023 : #endif
14024 :
14025 : /* "View.MemoryView":813
14026 : * cdef bint negative_step
14027 : *
14028 : * if not is_slice: # <<<<<<<<<<<<<<
14029 : *
14030 : * if start < 0:
14031 : */
14032 9855594 : __pyx_t_1 = (!__pyx_v_is_slice);
14033 9855594 : if (__pyx_t_1) {
14034 :
14035 : /* "View.MemoryView":815
14036 : * if not is_slice:
14037 : *
14038 : * if start < 0: # <<<<<<<<<<<<<<
14039 : * start += shape
14040 : * if not 0 <= start < shape:
14041 : */
14042 0 : __pyx_t_1 = (__pyx_v_start < 0);
14043 0 : if (__pyx_t_1) {
14044 :
14045 : /* "View.MemoryView":816
14046 : *
14047 : * if start < 0:
14048 : * start += shape # <<<<<<<<<<<<<<
14049 : * if not 0 <= start < shape:
14050 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
14051 : */
14052 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14053 :
14054 : /* "View.MemoryView":815
14055 : * if not is_slice:
14056 : *
14057 : * if start < 0: # <<<<<<<<<<<<<<
14058 : * start += shape
14059 : * if not 0 <= start < shape:
14060 : */
14061 : }
14062 :
14063 : /* "View.MemoryView":817
14064 : * if start < 0:
14065 : * start += shape
14066 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14067 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
14068 : * else:
14069 : */
14070 0 : __pyx_t_1 = (0 <= __pyx_v_start);
14071 0 : if (__pyx_t_1) {
14072 0 : __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
14073 : }
14074 0 : __pyx_t_2 = (!__pyx_t_1);
14075 0 : if (__pyx_t_2) {
14076 :
14077 : /* "View.MemoryView":818
14078 : * start += shape
14079 : * if not 0 <= start < shape:
14080 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
14081 : * else:
14082 : *
14083 : */
14084 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
14085 :
14086 : /* "View.MemoryView":817
14087 : * if start < 0:
14088 : * start += shape
14089 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
14090 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
14091 : * else:
14092 : */
14093 : }
14094 :
14095 : /* "View.MemoryView":813
14096 : * cdef bint negative_step
14097 : *
14098 : * if not is_slice: # <<<<<<<<<<<<<<
14099 : *
14100 : * if start < 0:
14101 : */
14102 0 : goto __pyx_L3;
14103 : }
14104 :
14105 : /* "View.MemoryView":821
14106 : * else:
14107 : *
14108 : * if have_step: # <<<<<<<<<<<<<<
14109 : * negative_step = step < 0
14110 : * if step == 0:
14111 : */
14112 9855594 : /*else*/ {
14113 9855594 : __pyx_t_2 = (__pyx_v_have_step != 0);
14114 9855594 : if (__pyx_t_2) {
14115 :
14116 : /* "View.MemoryView":822
14117 : *
14118 : * if have_step:
14119 : * negative_step = step < 0 # <<<<<<<<<<<<<<
14120 : * if step == 0:
14121 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
14122 : */
14123 0 : __pyx_v_negative_step = (__pyx_v_step < 0);
14124 :
14125 : /* "View.MemoryView":823
14126 : * if have_step:
14127 : * negative_step = step < 0
14128 : * if step == 0: # <<<<<<<<<<<<<<
14129 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
14130 : * else:
14131 : */
14132 0 : __pyx_t_2 = (__pyx_v_step == 0);
14133 0 : if (__pyx_t_2) {
14134 :
14135 : /* "View.MemoryView":824
14136 : * negative_step = step < 0
14137 : * if step == 0:
14138 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
14139 : * else:
14140 : * negative_step = False
14141 : */
14142 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
14143 :
14144 : /* "View.MemoryView":823
14145 : * if have_step:
14146 : * negative_step = step < 0
14147 : * if step == 0: # <<<<<<<<<<<<<<
14148 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
14149 : * else:
14150 : */
14151 : }
14152 :
14153 : /* "View.MemoryView":821
14154 : * else:
14155 : *
14156 : * if have_step: # <<<<<<<<<<<<<<
14157 : * negative_step = step < 0
14158 : * if step == 0:
14159 : */
14160 0 : goto __pyx_L6;
14161 : }
14162 :
14163 : /* "View.MemoryView":826
14164 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
14165 : * else:
14166 : * negative_step = False # <<<<<<<<<<<<<<
14167 : * step = 1
14168 : *
14169 : */
14170 : /*else*/ {
14171 : __pyx_v_negative_step = 0;
14172 :
14173 : /* "View.MemoryView":827
14174 : * else:
14175 : * negative_step = False
14176 : * step = 1 # <<<<<<<<<<<<<<
14177 : *
14178 : *
14179 : */
14180 : __pyx_v_step = 1;
14181 : }
14182 9855594 : __pyx_L6:;
14183 :
14184 : /* "View.MemoryView":830
14185 : *
14186 : *
14187 : * if have_start: # <<<<<<<<<<<<<<
14188 : * if start < 0:
14189 : * start += shape
14190 : */
14191 9855594 : __pyx_t_2 = (__pyx_v_have_start != 0);
14192 9855594 : if (__pyx_t_2) {
14193 :
14194 : /* "View.MemoryView":831
14195 : *
14196 : * if have_start:
14197 : * if start < 0: # <<<<<<<<<<<<<<
14198 : * start += shape
14199 : * if start < 0:
14200 : */
14201 0 : __pyx_t_2 = (__pyx_v_start < 0);
14202 0 : if (__pyx_t_2) {
14203 :
14204 : /* "View.MemoryView":832
14205 : * if have_start:
14206 : * if start < 0:
14207 : * start += shape # <<<<<<<<<<<<<<
14208 : * if start < 0:
14209 : * start = 0
14210 : */
14211 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
14212 :
14213 : /* "View.MemoryView":833
14214 : * if start < 0:
14215 : * start += shape
14216 : * if start < 0: # <<<<<<<<<<<<<<
14217 : * start = 0
14218 : * elif start >= shape:
14219 : */
14220 0 : __pyx_t_2 = (__pyx_v_start < 0);
14221 0 : if (__pyx_t_2) {
14222 :
14223 : /* "View.MemoryView":834
14224 : * start += shape
14225 : * if start < 0:
14226 : * start = 0 # <<<<<<<<<<<<<<
14227 : * elif start >= shape:
14228 : * if negative_step:
14229 : */
14230 : __pyx_v_start = 0;
14231 :
14232 : /* "View.MemoryView":833
14233 : * if start < 0:
14234 : * start += shape
14235 : * if start < 0: # <<<<<<<<<<<<<<
14236 : * start = 0
14237 : * elif start >= shape:
14238 : */
14239 : }
14240 :
14241 : /* "View.MemoryView":831
14242 : *
14243 : * if have_start:
14244 : * if start < 0: # <<<<<<<<<<<<<<
14245 : * start += shape
14246 : * if start < 0:
14247 : */
14248 0 : goto __pyx_L9;
14249 : }
14250 :
14251 : /* "View.MemoryView":835
14252 : * if start < 0:
14253 : * start = 0
14254 : * elif start >= shape: # <<<<<<<<<<<<<<
14255 : * if negative_step:
14256 : * start = shape - 1
14257 : */
14258 0 : __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
14259 0 : if (__pyx_t_2) {
14260 :
14261 : /* "View.MemoryView":836
14262 : * start = 0
14263 : * elif start >= shape:
14264 : * if negative_step: # <<<<<<<<<<<<<<
14265 : * start = shape - 1
14266 : * else:
14267 : */
14268 0 : if (__pyx_v_negative_step) {
14269 :
14270 : /* "View.MemoryView":837
14271 : * elif start >= shape:
14272 : * if negative_step:
14273 : * start = shape - 1 # <<<<<<<<<<<<<<
14274 : * else:
14275 : * start = shape
14276 : */
14277 0 : __pyx_v_start = (__pyx_v_shape - 1);
14278 :
14279 : /* "View.MemoryView":836
14280 : * start = 0
14281 : * elif start >= shape:
14282 : * if negative_step: # <<<<<<<<<<<<<<
14283 : * start = shape - 1
14284 : * else:
14285 : */
14286 0 : goto __pyx_L11;
14287 : }
14288 :
14289 : /* "View.MemoryView":839
14290 : * start = shape - 1
14291 : * else:
14292 : * start = shape # <<<<<<<<<<<<<<
14293 : * else:
14294 : * if negative_step:
14295 : */
14296 : /*else*/ {
14297 : __pyx_v_start = __pyx_v_shape;
14298 : }
14299 0 : __pyx_L11:;
14300 :
14301 : /* "View.MemoryView":835
14302 : * if start < 0:
14303 : * start = 0
14304 : * elif start >= shape: # <<<<<<<<<<<<<<
14305 : * if negative_step:
14306 : * start = shape - 1
14307 : */
14308 : }
14309 0 : __pyx_L9:;
14310 :
14311 : /* "View.MemoryView":830
14312 : *
14313 : *
14314 : * if have_start: # <<<<<<<<<<<<<<
14315 : * if start < 0:
14316 : * start += shape
14317 : */
14318 0 : goto __pyx_L8;
14319 : }
14320 :
14321 : /* "View.MemoryView":841
14322 : * start = shape
14323 : * else:
14324 : * if negative_step: # <<<<<<<<<<<<<<
14325 : * start = shape - 1
14326 : * else:
14327 : */
14328 9855594 : /*else*/ {
14329 9855594 : if (__pyx_v_negative_step) {
14330 :
14331 : /* "View.MemoryView":842
14332 : * else:
14333 : * if negative_step:
14334 : * start = shape - 1 # <<<<<<<<<<<<<<
14335 : * else:
14336 : * start = 0
14337 : */
14338 0 : __pyx_v_start = (__pyx_v_shape - 1);
14339 :
14340 : /* "View.MemoryView":841
14341 : * start = shape
14342 : * else:
14343 : * if negative_step: # <<<<<<<<<<<<<<
14344 : * start = shape - 1
14345 : * else:
14346 : */
14347 0 : goto __pyx_L12;
14348 : }
14349 :
14350 : /* "View.MemoryView":844
14351 : * start = shape - 1
14352 : * else:
14353 : * start = 0 # <<<<<<<<<<<<<<
14354 : *
14355 : * if have_stop:
14356 : */
14357 : /*else*/ {
14358 : __pyx_v_start = 0;
14359 : }
14360 9855594 : __pyx_L12:;
14361 : }
14362 9855594 : __pyx_L8:;
14363 :
14364 : /* "View.MemoryView":846
14365 : * start = 0
14366 : *
14367 : * if have_stop: # <<<<<<<<<<<<<<
14368 : * if stop < 0:
14369 : * stop += shape
14370 : */
14371 9855594 : __pyx_t_2 = (__pyx_v_have_stop != 0);
14372 9855594 : if (__pyx_t_2) {
14373 :
14374 : /* "View.MemoryView":847
14375 : *
14376 : * if have_stop:
14377 : * if stop < 0: # <<<<<<<<<<<<<<
14378 : * stop += shape
14379 : * if stop < 0:
14380 : */
14381 9855594 : __pyx_t_2 = (__pyx_v_stop < 0);
14382 9855594 : if (__pyx_t_2) {
14383 :
14384 : /* "View.MemoryView":848
14385 : * if have_stop:
14386 : * if stop < 0:
14387 : * stop += shape # <<<<<<<<<<<<<<
14388 : * if stop < 0:
14389 : * stop = 0
14390 : */
14391 0 : __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
14392 :
14393 : /* "View.MemoryView":849
14394 : * if stop < 0:
14395 : * stop += shape
14396 : * if stop < 0: # <<<<<<<<<<<<<<
14397 : * stop = 0
14398 : * elif stop > shape:
14399 : */
14400 0 : __pyx_t_2 = (__pyx_v_stop < 0);
14401 0 : if (__pyx_t_2) {
14402 :
14403 : /* "View.MemoryView":850
14404 : * stop += shape
14405 : * if stop < 0:
14406 : * stop = 0 # <<<<<<<<<<<<<<
14407 : * elif stop > shape:
14408 : * stop = shape
14409 : */
14410 : __pyx_v_stop = 0;
14411 :
14412 : /* "View.MemoryView":849
14413 : * if stop < 0:
14414 : * stop += shape
14415 : * if stop < 0: # <<<<<<<<<<<<<<
14416 : * stop = 0
14417 : * elif stop > shape:
14418 : */
14419 : }
14420 :
14421 : /* "View.MemoryView":847
14422 : *
14423 : * if have_stop:
14424 : * if stop < 0: # <<<<<<<<<<<<<<
14425 : * stop += shape
14426 : * if stop < 0:
14427 : */
14428 0 : goto __pyx_L14;
14429 : }
14430 :
14431 : /* "View.MemoryView":851
14432 : * if stop < 0:
14433 : * stop = 0
14434 : * elif stop > shape: # <<<<<<<<<<<<<<
14435 : * stop = shape
14436 : * else:
14437 : */
14438 9855594 : __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
14439 9855594 : if (__pyx_t_2) {
14440 :
14441 : /* "View.MemoryView":852
14442 : * stop = 0
14443 : * elif stop > shape:
14444 : * stop = shape # <<<<<<<<<<<<<<
14445 : * else:
14446 : * if negative_step:
14447 : */
14448 : __pyx_v_stop = __pyx_v_shape;
14449 :
14450 : /* "View.MemoryView":851
14451 : * if stop < 0:
14452 : * stop = 0
14453 : * elif stop > shape: # <<<<<<<<<<<<<<
14454 : * stop = shape
14455 : * else:
14456 : */
14457 : }
14458 9855594 : __pyx_L14:;
14459 :
14460 : /* "View.MemoryView":846
14461 : * start = 0
14462 : *
14463 : * if have_stop: # <<<<<<<<<<<<<<
14464 : * if stop < 0:
14465 : * stop += shape
14466 : */
14467 9855594 : goto __pyx_L13;
14468 : }
14469 :
14470 : /* "View.MemoryView":854
14471 : * stop = shape
14472 : * else:
14473 : * if negative_step: # <<<<<<<<<<<<<<
14474 : * stop = -1
14475 : * else:
14476 : */
14477 0 : /*else*/ {
14478 0 : if (__pyx_v_negative_step) {
14479 :
14480 : /* "View.MemoryView":855
14481 : * else:
14482 : * if negative_step:
14483 : * stop = -1 # <<<<<<<<<<<<<<
14484 : * else:
14485 : * stop = shape
14486 : */
14487 0 : __pyx_v_stop = -1L;
14488 :
14489 : /* "View.MemoryView":854
14490 : * stop = shape
14491 : * else:
14492 : * if negative_step: # <<<<<<<<<<<<<<
14493 : * stop = -1
14494 : * else:
14495 : */
14496 0 : goto __pyx_L16;
14497 : }
14498 :
14499 : /* "View.MemoryView":857
14500 : * stop = -1
14501 : * else:
14502 : * stop = shape # <<<<<<<<<<<<<<
14503 : *
14504 : *
14505 : */
14506 : /*else*/ {
14507 : __pyx_v_stop = __pyx_v_shape;
14508 : }
14509 9855594 : __pyx_L16:;
14510 : }
14511 9855594 : __pyx_L13:;
14512 :
14513 : /* "View.MemoryView":861
14514 : *
14515 : * with cython.cdivision(True):
14516 : * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
14517 : *
14518 : * if (stop - start) - step * new_shape:
14519 : */
14520 9855594 : __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
14521 :
14522 : /* "View.MemoryView":863
14523 : * new_shape = (stop - start) // step
14524 : *
14525 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
14526 : * new_shape += 1
14527 : *
14528 : */
14529 9855594 : __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
14530 9855594 : if (__pyx_t_2) {
14531 :
14532 : /* "View.MemoryView":864
14533 : *
14534 : * if (stop - start) - step * new_shape:
14535 : * new_shape += 1 # <<<<<<<<<<<<<<
14536 : *
14537 : * if new_shape < 0:
14538 : */
14539 0 : __pyx_v_new_shape = (__pyx_v_new_shape + 1);
14540 :
14541 : /* "View.MemoryView":863
14542 : * new_shape = (stop - start) // step
14543 : *
14544 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
14545 : * new_shape += 1
14546 : *
14547 : */
14548 : }
14549 :
14550 : /* "View.MemoryView":866
14551 : * new_shape += 1
14552 : *
14553 : * if new_shape < 0: # <<<<<<<<<<<<<<
14554 : * new_shape = 0
14555 : *
14556 : */
14557 9855594 : __pyx_t_2 = (__pyx_v_new_shape < 0);
14558 9855594 : if (__pyx_t_2) {
14559 :
14560 : /* "View.MemoryView":867
14561 : *
14562 : * if new_shape < 0:
14563 : * new_shape = 0 # <<<<<<<<<<<<<<
14564 : *
14565 : *
14566 : */
14567 : __pyx_v_new_shape = 0;
14568 :
14569 : /* "View.MemoryView":866
14570 : * new_shape += 1
14571 : *
14572 : * if new_shape < 0: # <<<<<<<<<<<<<<
14573 : * new_shape = 0
14574 : *
14575 : */
14576 : }
14577 :
14578 : /* "View.MemoryView":870
14579 : *
14580 : *
14581 : * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
14582 : * dst.shape[new_ndim] = new_shape
14583 : * dst.suboffsets[new_ndim] = suboffset
14584 : */
14585 9855594 : (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
14586 :
14587 : /* "View.MemoryView":871
14588 : *
14589 : * dst.strides[new_ndim] = stride * step
14590 : * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
14591 : * dst.suboffsets[new_ndim] = suboffset
14592 : *
14593 : */
14594 9855594 : (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
14595 :
14596 : /* "View.MemoryView":872
14597 : * dst.strides[new_ndim] = stride * step
14598 : * dst.shape[new_ndim] = new_shape
14599 : * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
14600 : *
14601 : *
14602 : */
14603 9855594 : (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
14604 : }
14605 9855594 : __pyx_L3:;
14606 :
14607 : /* "View.MemoryView":875
14608 : *
14609 : *
14610 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
14611 : * dst.data += start * stride
14612 : * else:
14613 : */
14614 9855594 : __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
14615 9855594 : if (__pyx_t_2) {
14616 :
14617 : /* "View.MemoryView":876
14618 : *
14619 : * if suboffset_dim[0] < 0:
14620 : * dst.data += start * stride # <<<<<<<<<<<<<<
14621 : * else:
14622 : * dst.suboffsets[suboffset_dim[0]] += start * stride
14623 : */
14624 9855594 : __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
14625 :
14626 : /* "View.MemoryView":875
14627 : *
14628 : *
14629 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
14630 : * dst.data += start * stride
14631 : * else:
14632 : */
14633 9855594 : goto __pyx_L19;
14634 : }
14635 :
14636 : /* "View.MemoryView":878
14637 : * dst.data += start * stride
14638 : * else:
14639 : * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
14640 : *
14641 : * if suboffset >= 0:
14642 : */
14643 0 : /*else*/ {
14644 0 : __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
14645 0 : (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
14646 : }
14647 9855594 : __pyx_L19:;
14648 :
14649 : /* "View.MemoryView":880
14650 : * dst.suboffsets[suboffset_dim[0]] += start * stride
14651 : *
14652 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14653 : * if not is_slice:
14654 : * if new_ndim == 0:
14655 : */
14656 9855594 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
14657 9855594 : if (__pyx_t_2) {
14658 :
14659 : /* "View.MemoryView":881
14660 : *
14661 : * if suboffset >= 0:
14662 : * if not is_slice: # <<<<<<<<<<<<<<
14663 : * if new_ndim == 0:
14664 : * dst.data = (<char **> dst.data)[0] + suboffset
14665 : */
14666 0 : __pyx_t_2 = (!__pyx_v_is_slice);
14667 0 : if (__pyx_t_2) {
14668 :
14669 : /* "View.MemoryView":882
14670 : * if suboffset >= 0:
14671 : * if not is_slice:
14672 : * if new_ndim == 0: # <<<<<<<<<<<<<<
14673 : * dst.data = (<char **> dst.data)[0] + suboffset
14674 : * else:
14675 : */
14676 0 : __pyx_t_2 = (__pyx_v_new_ndim == 0);
14677 0 : if (__pyx_t_2) {
14678 :
14679 : /* "View.MemoryView":883
14680 : * if not is_slice:
14681 : * if new_ndim == 0:
14682 : * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
14683 : * else:
14684 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
14685 : */
14686 0 : __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
14687 :
14688 : /* "View.MemoryView":882
14689 : * if suboffset >= 0:
14690 : * if not is_slice:
14691 : * if new_ndim == 0: # <<<<<<<<<<<<<<
14692 : * dst.data = (<char **> dst.data)[0] + suboffset
14693 : * else:
14694 : */
14695 0 : goto __pyx_L22;
14696 : }
14697 :
14698 : /* "View.MemoryView":885
14699 : * dst.data = (<char **> dst.data)[0] + suboffset
14700 : * else:
14701 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
14702 : * "must be indexed and not sliced", dim)
14703 : * else:
14704 : */
14705 0 : /*else*/ {
14706 :
14707 : /* "View.MemoryView":886
14708 : * else:
14709 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
14710 : * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
14711 : * else:
14712 : * suboffset_dim[0] = new_ndim
14713 : */
14714 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
14715 : }
14716 0 : __pyx_L22:;
14717 :
14718 : /* "View.MemoryView":881
14719 : *
14720 : * if suboffset >= 0:
14721 : * if not is_slice: # <<<<<<<<<<<<<<
14722 : * if new_ndim == 0:
14723 : * dst.data = (<char **> dst.data)[0] + suboffset
14724 : */
14725 0 : goto __pyx_L21;
14726 : }
14727 :
14728 : /* "View.MemoryView":888
14729 : * "must be indexed and not sliced", dim)
14730 : * else:
14731 : * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
14732 : *
14733 : * return 0
14734 : */
14735 0 : /*else*/ {
14736 0 : (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
14737 : }
14738 9855594 : __pyx_L21:;
14739 :
14740 : /* "View.MemoryView":880
14741 : * dst.suboffsets[suboffset_dim[0]] += start * stride
14742 : *
14743 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14744 : * if not is_slice:
14745 : * if new_ndim == 0:
14746 : */
14747 : }
14748 :
14749 : /* "View.MemoryView":890
14750 : * suboffset_dim[0] = new_ndim
14751 : *
14752 : * return 0 # <<<<<<<<<<<<<<
14753 : *
14754 : *
14755 : */
14756 9855594 : __pyx_r = 0;
14757 9855594 : goto __pyx_L0;
14758 :
14759 : /* "View.MemoryView":793
14760 : *
14761 : * @cname('__pyx_memoryview_slice_memviewslice')
14762 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
14763 : * __Pyx_memviewslice *dst,
14764 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
14765 : */
14766 :
14767 : /* function exit code */
14768 0 : __pyx_L1_error:;
14769 : #ifdef WITH_THREAD
14770 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14771 : #endif
14772 0 : __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14773 0 : __pyx_r = -1;
14774 : #ifdef WITH_THREAD
14775 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
14776 : #endif
14777 9855594 : __pyx_L0:;
14778 9855594 : return __pyx_r;
14779 : }
14780 :
14781 : /* "View.MemoryView":896
14782 : *
14783 : * @cname('__pyx_pybuffer_index')
14784 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14785 : * Py_ssize_t dim) except NULL:
14786 : * cdef Py_ssize_t shape, stride, suboffset = -1
14787 : */
14788 :
14789 2834 : static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
14790 2834 : Py_ssize_t __pyx_v_shape;
14791 2834 : Py_ssize_t __pyx_v_stride;
14792 2834 : Py_ssize_t __pyx_v_suboffset;
14793 2834 : Py_ssize_t __pyx_v_itemsize;
14794 2834 : char *__pyx_v_resultp;
14795 2834 : char *__pyx_r;
14796 : __Pyx_RefNannyDeclarations
14797 2834 : Py_ssize_t __pyx_t_1;
14798 2834 : int __pyx_t_2;
14799 2834 : PyObject *__pyx_t_3 = NULL;
14800 2834 : Py_UCS4 __pyx_t_4;
14801 2834 : PyObject *__pyx_t_5 = NULL;
14802 2834 : int __pyx_lineno = 0;
14803 2834 : const char *__pyx_filename = NULL;
14804 2834 : int __pyx_clineno = 0;
14805 2834 : __Pyx_RefNannySetupContext("pybuffer_index", 1);
14806 :
14807 : /* "View.MemoryView":898
14808 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
14809 : * Py_ssize_t dim) except NULL:
14810 : * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
14811 : * cdef Py_ssize_t itemsize = view.itemsize
14812 : * cdef char *resultp
14813 : */
14814 2834 : __pyx_v_suboffset = -1L;
14815 :
14816 : /* "View.MemoryView":899
14817 : * Py_ssize_t dim) except NULL:
14818 : * cdef Py_ssize_t shape, stride, suboffset = -1
14819 : * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
14820 : * cdef char *resultp
14821 : *
14822 : */
14823 2834 : __pyx_t_1 = __pyx_v_view->itemsize;
14824 2834 : __pyx_v_itemsize = __pyx_t_1;
14825 :
14826 : /* "View.MemoryView":902
14827 : * cdef char *resultp
14828 : *
14829 : * if view.ndim == 0: # <<<<<<<<<<<<<<
14830 : * shape = view.len // itemsize
14831 : * stride = itemsize
14832 : */
14833 2834 : __pyx_t_2 = (__pyx_v_view->ndim == 0);
14834 2834 : if (__pyx_t_2) {
14835 :
14836 : /* "View.MemoryView":903
14837 : *
14838 : * if view.ndim == 0:
14839 : * shape = view.len // itemsize # <<<<<<<<<<<<<<
14840 : * stride = itemsize
14841 : * else:
14842 : */
14843 0 : if (unlikely(__pyx_v_itemsize == 0)) {
14844 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
14845 0 : __PYX_ERR(1, 903, __pyx_L1_error)
14846 : }
14847 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
14848 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
14849 0 : __PYX_ERR(1, 903, __pyx_L1_error)
14850 : }
14851 0 : __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
14852 :
14853 : /* "View.MemoryView":904
14854 : * if view.ndim == 0:
14855 : * shape = view.len // itemsize
14856 : * stride = itemsize # <<<<<<<<<<<<<<
14857 : * else:
14858 : * shape = view.shape[dim]
14859 : */
14860 0 : __pyx_v_stride = __pyx_v_itemsize;
14861 :
14862 : /* "View.MemoryView":902
14863 : * cdef char *resultp
14864 : *
14865 : * if view.ndim == 0: # <<<<<<<<<<<<<<
14866 : * shape = view.len // itemsize
14867 : * stride = itemsize
14868 : */
14869 0 : goto __pyx_L3;
14870 : }
14871 :
14872 : /* "View.MemoryView":906
14873 : * stride = itemsize
14874 : * else:
14875 : * shape = view.shape[dim] # <<<<<<<<<<<<<<
14876 : * stride = view.strides[dim]
14877 : * if view.suboffsets != NULL:
14878 : */
14879 2834 : /*else*/ {
14880 2834 : __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
14881 :
14882 : /* "View.MemoryView":907
14883 : * else:
14884 : * shape = view.shape[dim]
14885 : * stride = view.strides[dim] # <<<<<<<<<<<<<<
14886 : * if view.suboffsets != NULL:
14887 : * suboffset = view.suboffsets[dim]
14888 : */
14889 2834 : __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
14890 :
14891 : /* "View.MemoryView":908
14892 : * shape = view.shape[dim]
14893 : * stride = view.strides[dim]
14894 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14895 : * suboffset = view.suboffsets[dim]
14896 : *
14897 : */
14898 2834 : __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
14899 2834 : if (__pyx_t_2) {
14900 :
14901 : /* "View.MemoryView":909
14902 : * stride = view.strides[dim]
14903 : * if view.suboffsets != NULL:
14904 : * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
14905 : *
14906 : * if index < 0:
14907 : */
14908 0 : __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
14909 :
14910 : /* "View.MemoryView":908
14911 : * shape = view.shape[dim]
14912 : * stride = view.strides[dim]
14913 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
14914 : * suboffset = view.suboffsets[dim]
14915 : *
14916 : */
14917 : }
14918 : }
14919 2834 : __pyx_L3:;
14920 :
14921 : /* "View.MemoryView":911
14922 : * suboffset = view.suboffsets[dim]
14923 : *
14924 : * if index < 0: # <<<<<<<<<<<<<<
14925 : * index += view.shape[dim]
14926 : * if index < 0:
14927 : */
14928 2834 : __pyx_t_2 = (__pyx_v_index < 0);
14929 2834 : if (__pyx_t_2) {
14930 :
14931 : /* "View.MemoryView":912
14932 : *
14933 : * if index < 0:
14934 : * index += view.shape[dim] # <<<<<<<<<<<<<<
14935 : * if index < 0:
14936 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14937 : */
14938 0 : __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14939 :
14940 : /* "View.MemoryView":913
14941 : * if index < 0:
14942 : * index += view.shape[dim]
14943 : * if index < 0: # <<<<<<<<<<<<<<
14944 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14945 : *
14946 : */
14947 0 : __pyx_t_2 = (__pyx_v_index < 0);
14948 0 : if (unlikely(__pyx_t_2)) {
14949 :
14950 : /* "View.MemoryView":914
14951 : * index += view.shape[dim]
14952 : * if index < 0:
14953 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14954 : *
14955 : * if index >= shape:
14956 : */
14957 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
14958 0 : __Pyx_GOTREF(__pyx_t_3);
14959 0 : __pyx_t_1 = 0;
14960 0 : __pyx_t_4 = 127;
14961 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14962 0 : __pyx_t_1 += 37;
14963 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14964 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14965 0 : __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14966 0 : __Pyx_GOTREF(__pyx_t_5);
14967 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
14968 0 : __Pyx_GIVEREF(__pyx_t_5);
14969 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
14970 0 : __pyx_t_5 = 0;
14971 0 : __Pyx_INCREF(__pyx_kp_u__7);
14972 0 : __pyx_t_1 += 1;
14973 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14974 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7);
14975 0 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14976 0 : __Pyx_GOTREF(__pyx_t_5);
14977 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14978 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
14979 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14980 0 : __PYX_ERR(1, 914, __pyx_L1_error)
14981 :
14982 : /* "View.MemoryView":913
14983 : * if index < 0:
14984 : * index += view.shape[dim]
14985 : * if index < 0: # <<<<<<<<<<<<<<
14986 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14987 : *
14988 : */
14989 : }
14990 :
14991 : /* "View.MemoryView":911
14992 : * suboffset = view.suboffsets[dim]
14993 : *
14994 : * if index < 0: # <<<<<<<<<<<<<<
14995 : * index += view.shape[dim]
14996 : * if index < 0:
14997 : */
14998 : }
14999 :
15000 : /* "View.MemoryView":916
15001 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15002 : *
15003 : * if index >= shape: # <<<<<<<<<<<<<<
15004 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15005 : *
15006 : */
15007 2834 : __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
15008 2834 : if (unlikely(__pyx_t_2)) {
15009 :
15010 : /* "View.MemoryView":917
15011 : *
15012 : * if index >= shape:
15013 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
15014 : *
15015 : * resultp = bufp + index * stride
15016 : */
15017 692 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
15018 692 : __Pyx_GOTREF(__pyx_t_5);
15019 692 : __pyx_t_1 = 0;
15020 692 : __pyx_t_4 = 127;
15021 692 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15022 692 : __pyx_t_1 += 37;
15023 692 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15024 692 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
15025 692 : __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
15026 692 : __Pyx_GOTREF(__pyx_t_3);
15027 692 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
15028 692 : __Pyx_GIVEREF(__pyx_t_3);
15029 692 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
15030 692 : __pyx_t_3 = 0;
15031 692 : __Pyx_INCREF(__pyx_kp_u__7);
15032 692 : __pyx_t_1 += 1;
15033 692 : __Pyx_GIVEREF(__pyx_kp_u__7);
15034 692 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7);
15035 692 : __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
15036 692 : __Pyx_GOTREF(__pyx_t_3);
15037 692 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15038 692 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
15039 692 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15040 692 : __PYX_ERR(1, 917, __pyx_L1_error)
15041 :
15042 : /* "View.MemoryView":916
15043 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15044 : *
15045 : * if index >= shape: # <<<<<<<<<<<<<<
15046 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15047 : *
15048 : */
15049 : }
15050 :
15051 : /* "View.MemoryView":919
15052 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
15053 : *
15054 : * resultp = bufp + index * stride # <<<<<<<<<<<<<<
15055 : * if suboffset >= 0:
15056 : * resultp = (<char **> resultp)[0] + suboffset
15057 : */
15058 2142 : __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
15059 :
15060 : /* "View.MemoryView":920
15061 : *
15062 : * resultp = bufp + index * stride
15063 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15064 : * resultp = (<char **> resultp)[0] + suboffset
15065 : *
15066 : */
15067 2142 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
15068 2142 : if (__pyx_t_2) {
15069 :
15070 : /* "View.MemoryView":921
15071 : * resultp = bufp + index * stride
15072 : * if suboffset >= 0:
15073 : * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
15074 : *
15075 : * return resultp
15076 : */
15077 0 : __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
15078 :
15079 : /* "View.MemoryView":920
15080 : *
15081 : * resultp = bufp + index * stride
15082 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15083 : * resultp = (<char **> resultp)[0] + suboffset
15084 : *
15085 : */
15086 : }
15087 :
15088 : /* "View.MemoryView":923
15089 : * resultp = (<char **> resultp)[0] + suboffset
15090 : *
15091 : * return resultp # <<<<<<<<<<<<<<
15092 : *
15093 : *
15094 : */
15095 2142 : __pyx_r = __pyx_v_resultp;
15096 2142 : goto __pyx_L0;
15097 :
15098 : /* "View.MemoryView":896
15099 : *
15100 : * @cname('__pyx_pybuffer_index')
15101 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
15102 : * Py_ssize_t dim) except NULL:
15103 : * cdef Py_ssize_t shape, stride, suboffset = -1
15104 : */
15105 :
15106 : /* function exit code */
15107 692 : __pyx_L1_error:;
15108 692 : __Pyx_XDECREF(__pyx_t_3);
15109 692 : __Pyx_XDECREF(__pyx_t_5);
15110 692 : __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
15111 692 : __pyx_r = NULL;
15112 2834 : __pyx_L0:;
15113 2834 : __Pyx_RefNannyFinishContext();
15114 2834 : return __pyx_r;
15115 : }
15116 :
15117 : /* "View.MemoryView":929
15118 : *
15119 : * @cname('__pyx_memslice_transpose')
15120 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
15121 : * cdef int ndim = memslice.memview.view.ndim
15122 : *
15123 : */
15124 :
15125 0 : static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
15126 0 : int __pyx_v_ndim;
15127 0 : Py_ssize_t *__pyx_v_shape;
15128 0 : Py_ssize_t *__pyx_v_strides;
15129 0 : int __pyx_v_i;
15130 0 : int __pyx_v_j;
15131 0 : int __pyx_r;
15132 0 : int __pyx_t_1;
15133 0 : Py_ssize_t *__pyx_t_2;
15134 0 : long __pyx_t_3;
15135 0 : long __pyx_t_4;
15136 0 : Py_ssize_t __pyx_t_5;
15137 0 : Py_ssize_t __pyx_t_6;
15138 0 : int __pyx_t_7;
15139 0 : int __pyx_t_8;
15140 0 : int __pyx_t_9;
15141 0 : int __pyx_lineno = 0;
15142 0 : const char *__pyx_filename = NULL;
15143 0 : int __pyx_clineno = 0;
15144 : #ifdef WITH_THREAD
15145 0 : PyGILState_STATE __pyx_gilstate_save;
15146 : #endif
15147 :
15148 : /* "View.MemoryView":930
15149 : * @cname('__pyx_memslice_transpose')
15150 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
15151 : * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
15152 : *
15153 : * cdef Py_ssize_t *shape = memslice.shape
15154 : */
15155 0 : __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
15156 0 : __pyx_v_ndim = __pyx_t_1;
15157 :
15158 : /* "View.MemoryView":932
15159 : * cdef int ndim = memslice.memview.view.ndim
15160 : *
15161 : * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
15162 : * cdef Py_ssize_t *strides = memslice.strides
15163 : *
15164 : */
15165 0 : __pyx_t_2 = __pyx_v_memslice->shape;
15166 0 : __pyx_v_shape = __pyx_t_2;
15167 :
15168 : /* "View.MemoryView":933
15169 : *
15170 : * cdef Py_ssize_t *shape = memslice.shape
15171 : * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
15172 : *
15173 : *
15174 : */
15175 0 : __pyx_t_2 = __pyx_v_memslice->strides;
15176 0 : __pyx_v_strides = __pyx_t_2;
15177 :
15178 : /* "View.MemoryView":937
15179 : *
15180 : * cdef int i, j
15181 : * for i in range(ndim // 2): # <<<<<<<<<<<<<<
15182 : * j = ndim - 1 - i
15183 : * strides[i], strides[j] = strides[j], strides[i]
15184 : */
15185 0 : __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
15186 0 : __pyx_t_4 = __pyx_t_3;
15187 0 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
15188 0 : __pyx_v_i = __pyx_t_1;
15189 :
15190 : /* "View.MemoryView":938
15191 : * cdef int i, j
15192 : * for i in range(ndim // 2):
15193 : * j = ndim - 1 - i # <<<<<<<<<<<<<<
15194 : * strides[i], strides[j] = strides[j], strides[i]
15195 : * shape[i], shape[j] = shape[j], shape[i]
15196 : */
15197 0 : __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
15198 :
15199 : /* "View.MemoryView":939
15200 : * for i in range(ndim // 2):
15201 : * j = ndim - 1 - i
15202 : * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
15203 : * shape[i], shape[j] = shape[j], shape[i]
15204 : *
15205 : */
15206 0 : __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
15207 0 : __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
15208 0 : (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
15209 0 : (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
15210 :
15211 : /* "View.MemoryView":940
15212 : * j = ndim - 1 - i
15213 : * strides[i], strides[j] = strides[j], strides[i]
15214 : * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
15215 : *
15216 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15217 : */
15218 0 : __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
15219 0 : __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
15220 0 : (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
15221 0 : (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
15222 :
15223 : /* "View.MemoryView":942
15224 : * shape[i], shape[j] = shape[j], shape[i]
15225 : *
15226 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15227 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15228 : *
15229 : */
15230 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
15231 0 : if (!__pyx_t_8) {
15232 : } else {
15233 0 : __pyx_t_7 = __pyx_t_8;
15234 0 : goto __pyx_L6_bool_binop_done;
15235 : }
15236 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
15237 0 : __pyx_t_7 = __pyx_t_8;
15238 0 : __pyx_L6_bool_binop_done:;
15239 0 : if (__pyx_t_7) {
15240 :
15241 : /* "View.MemoryView":943
15242 : *
15243 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
15244 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
15245 : *
15246 : * return 0
15247 : */
15248 0 : __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
15249 :
15250 : /* "View.MemoryView":942
15251 : * shape[i], shape[j] = shape[j], shape[i]
15252 : *
15253 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
15254 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15255 : *
15256 : */
15257 : }
15258 : }
15259 :
15260 : /* "View.MemoryView":945
15261 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
15262 : *
15263 : * return 0 # <<<<<<<<<<<<<<
15264 : *
15265 : *
15266 : */
15267 0 : __pyx_r = 0;
15268 0 : goto __pyx_L0;
15269 :
15270 : /* "View.MemoryView":929
15271 : *
15272 : * @cname('__pyx_memslice_transpose')
15273 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
15274 : * cdef int ndim = memslice.memview.view.ndim
15275 : *
15276 : */
15277 :
15278 : /* function exit code */
15279 0 : __pyx_L1_error:;
15280 : #ifdef WITH_THREAD
15281 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15282 : #endif
15283 0 : __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15284 0 : __pyx_r = -1;
15285 : #ifdef WITH_THREAD
15286 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
15287 : #endif
15288 0 : __pyx_L0:;
15289 0 : return __pyx_r;
15290 : }
15291 :
15292 : /* "View.MemoryView":963
15293 : * cdef int (*to_dtype_func)(char *, object) except 0
15294 : *
15295 : * def __dealloc__(self): # <<<<<<<<<<<<<<
15296 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15297 : *
15298 : */
15299 :
15300 : /* Python wrapper */
15301 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
15302 2484 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
15303 2484 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15304 : __Pyx_RefNannyDeclarations
15305 2484 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
15306 2484 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
15307 4968 : __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15308 :
15309 : /* function exit code */
15310 2484 : __Pyx_RefNannyFinishContext();
15311 : }
15312 :
15313 2484 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15314 :
15315 : /* "View.MemoryView":964
15316 : *
15317 : * def __dealloc__(self):
15318 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
15319 : *
15320 : * cdef convert_item_to_object(self, char *itemp):
15321 : */
15322 2484 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
15323 :
15324 : /* "View.MemoryView":963
15325 : * cdef int (*to_dtype_func)(char *, object) except 0
15326 : *
15327 : * def __dealloc__(self): # <<<<<<<<<<<<<<
15328 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15329 : *
15330 : */
15331 :
15332 : /* function exit code */
15333 : }
15334 :
15335 : /* "View.MemoryView":966
15336 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15337 : *
15338 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15339 : * if self.to_object_func != NULL:
15340 : * return self.to_object_func(itemp)
15341 : */
15342 :
15343 2142 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
15344 2142 : PyObject *__pyx_r = NULL;
15345 : __Pyx_RefNannyDeclarations
15346 2142 : int __pyx_t_1;
15347 2142 : PyObject *__pyx_t_2 = NULL;
15348 2142 : int __pyx_lineno = 0;
15349 2142 : const char *__pyx_filename = NULL;
15350 2142 : int __pyx_clineno = 0;
15351 2142 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
15352 :
15353 : /* "View.MemoryView":967
15354 : *
15355 : * cdef convert_item_to_object(self, char *itemp):
15356 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15357 : * return self.to_object_func(itemp)
15358 : * else:
15359 : */
15360 2142 : __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
15361 2142 : if (__pyx_t_1) {
15362 :
15363 : /* "View.MemoryView":968
15364 : * cdef convert_item_to_object(self, char *itemp):
15365 : * if self.to_object_func != NULL:
15366 : * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
15367 : * else:
15368 : * return memoryview.convert_item_to_object(self, itemp)
15369 : */
15370 2142 : __Pyx_XDECREF(__pyx_r);
15371 2142 : __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
15372 2142 : __Pyx_GOTREF(__pyx_t_2);
15373 2142 : __pyx_r = __pyx_t_2;
15374 2142 : __pyx_t_2 = 0;
15375 2142 : goto __pyx_L0;
15376 :
15377 : /* "View.MemoryView":967
15378 : *
15379 : * cdef convert_item_to_object(self, char *itemp):
15380 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
15381 : * return self.to_object_func(itemp)
15382 : * else:
15383 : */
15384 : }
15385 :
15386 : /* "View.MemoryView":970
15387 : * return self.to_object_func(itemp)
15388 : * else:
15389 : * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
15390 : *
15391 : * cdef assign_item_from_object(self, char *itemp, object value):
15392 : */
15393 0 : /*else*/ {
15394 0 : __Pyx_XDECREF(__pyx_r);
15395 0 : __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
15396 0 : __Pyx_GOTREF(__pyx_t_2);
15397 0 : __pyx_r = __pyx_t_2;
15398 0 : __pyx_t_2 = 0;
15399 0 : goto __pyx_L0;
15400 : }
15401 :
15402 : /* "View.MemoryView":966
15403 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
15404 : *
15405 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
15406 : * if self.to_object_func != NULL:
15407 : * return self.to_object_func(itemp)
15408 : */
15409 :
15410 : /* function exit code */
15411 0 : __pyx_L1_error:;
15412 0 : __Pyx_XDECREF(__pyx_t_2);
15413 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15414 0 : __pyx_r = 0;
15415 2142 : __pyx_L0:;
15416 2142 : __Pyx_XGIVEREF(__pyx_r);
15417 2142 : __Pyx_RefNannyFinishContext();
15418 2142 : return __pyx_r;
15419 : }
15420 :
15421 : /* "View.MemoryView":972
15422 : * return memoryview.convert_item_to_object(self, itemp)
15423 : *
15424 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15425 : * if self.to_dtype_func != NULL:
15426 : * self.to_dtype_func(itemp, value)
15427 : */
15428 :
15429 0 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
15430 0 : PyObject *__pyx_r = NULL;
15431 : __Pyx_RefNannyDeclarations
15432 0 : int __pyx_t_1;
15433 0 : int __pyx_t_2;
15434 0 : PyObject *__pyx_t_3 = NULL;
15435 0 : int __pyx_lineno = 0;
15436 0 : const char *__pyx_filename = NULL;
15437 0 : int __pyx_clineno = 0;
15438 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
15439 :
15440 : /* "View.MemoryView":973
15441 : *
15442 : * cdef assign_item_from_object(self, char *itemp, object value):
15443 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15444 : * self.to_dtype_func(itemp, value)
15445 : * else:
15446 : */
15447 0 : __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
15448 0 : if (__pyx_t_1) {
15449 :
15450 : /* "View.MemoryView":974
15451 : * cdef assign_item_from_object(self, char *itemp, object value):
15452 : * if self.to_dtype_func != NULL:
15453 : * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
15454 : * else:
15455 : * memoryview.assign_item_from_object(self, itemp, value)
15456 : */
15457 0 : __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
15458 :
15459 : /* "View.MemoryView":973
15460 : *
15461 : * cdef assign_item_from_object(self, char *itemp, object value):
15462 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
15463 : * self.to_dtype_func(itemp, value)
15464 : * else:
15465 : */
15466 0 : goto __pyx_L3;
15467 : }
15468 :
15469 : /* "View.MemoryView":976
15470 : * self.to_dtype_func(itemp, value)
15471 : * else:
15472 : * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
15473 : *
15474 : * cdef _get_base(self):
15475 : */
15476 0 : /*else*/ {
15477 0 : __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
15478 0 : __Pyx_GOTREF(__pyx_t_3);
15479 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15480 : }
15481 0 : __pyx_L3:;
15482 :
15483 : /* "View.MemoryView":972
15484 : * return memoryview.convert_item_to_object(self, itemp)
15485 : *
15486 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
15487 : * if self.to_dtype_func != NULL:
15488 : * self.to_dtype_func(itemp, value)
15489 : */
15490 :
15491 : /* function exit code */
15492 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15493 0 : goto __pyx_L0;
15494 0 : __pyx_L1_error:;
15495 0 : __Pyx_XDECREF(__pyx_t_3);
15496 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
15497 0 : __pyx_r = 0;
15498 0 : __pyx_L0:;
15499 0 : __Pyx_XGIVEREF(__pyx_r);
15500 0 : __Pyx_RefNannyFinishContext();
15501 0 : return __pyx_r;
15502 : }
15503 :
15504 : /* "View.MemoryView":978
15505 : * memoryview.assign_item_from_object(self, itemp, value)
15506 : *
15507 : * cdef _get_base(self): # <<<<<<<<<<<<<<
15508 : * return self.from_object
15509 : *
15510 : */
15511 :
15512 0 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15513 0 : PyObject *__pyx_r = NULL;
15514 : __Pyx_RefNannyDeclarations
15515 0 : __Pyx_RefNannySetupContext("_get_base", 1);
15516 :
15517 : /* "View.MemoryView":979
15518 : *
15519 : * cdef _get_base(self):
15520 : * return self.from_object # <<<<<<<<<<<<<<
15521 : *
15522 : *
15523 : */
15524 0 : __Pyx_XDECREF(__pyx_r);
15525 0 : __Pyx_INCREF(__pyx_v_self->from_object);
15526 0 : __pyx_r = __pyx_v_self->from_object;
15527 0 : goto __pyx_L0;
15528 :
15529 : /* "View.MemoryView":978
15530 : * memoryview.assign_item_from_object(self, itemp, value)
15531 : *
15532 : * cdef _get_base(self): # <<<<<<<<<<<<<<
15533 : * return self.from_object
15534 : *
15535 : */
15536 :
15537 : /* function exit code */
15538 0 : __pyx_L0:;
15539 0 : __Pyx_XGIVEREF(__pyx_r);
15540 0 : __Pyx_RefNannyFinishContext();
15541 0 : return __pyx_r;
15542 : }
15543 :
15544 : /* "(tree fragment)":1
15545 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15546 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15547 : * def __setstate_cython__(self, __pyx_state):
15548 : */
15549 :
15550 : /* Python wrapper */
15551 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
15552 : #if CYTHON_METH_FASTCALL
15553 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15554 : #else
15555 : PyObject *__pyx_args, PyObject *__pyx_kwds
15556 : #endif
15557 : ); /*proto*/
15558 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
15559 : #if CYTHON_METH_FASTCALL
15560 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15561 : #else
15562 : PyObject *__pyx_args, PyObject *__pyx_kwds
15563 : #endif
15564 : ) {
15565 : #if !CYTHON_METH_FASTCALL
15566 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15567 : #endif
15568 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15569 0 : PyObject *__pyx_r = 0;
15570 : __Pyx_RefNannyDeclarations
15571 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15572 : #if !CYTHON_METH_FASTCALL
15573 : #if CYTHON_ASSUME_SAFE_MACROS
15574 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15575 : #else
15576 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15577 : #endif
15578 : #endif
15579 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15580 0 : if (unlikely(__pyx_nargs > 0)) {
15581 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
15582 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
15583 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
15584 :
15585 : /* function exit code */
15586 0 : __Pyx_RefNannyFinishContext();
15587 0 : return __pyx_r;
15588 : }
15589 :
15590 0 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
15591 0 : PyObject *__pyx_r = NULL;
15592 : __Pyx_RefNannyDeclarations
15593 0 : int __pyx_lineno = 0;
15594 0 : const char *__pyx_filename = NULL;
15595 0 : int __pyx_clineno = 0;
15596 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
15597 :
15598 : /* "(tree fragment)":2
15599 : * def __reduce_cython__(self):
15600 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15601 : * def __setstate_cython__(self, __pyx_state):
15602 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15603 : */
15604 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
15605 0 : __PYX_ERR(1, 2, __pyx_L1_error)
15606 :
15607 : /* "(tree fragment)":1
15608 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15609 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15610 : * def __setstate_cython__(self, __pyx_state):
15611 : */
15612 :
15613 : /* function exit code */
15614 0 : __pyx_L1_error:;
15615 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15616 0 : __pyx_r = NULL;
15617 0 : __Pyx_XGIVEREF(__pyx_r);
15618 0 : __Pyx_RefNannyFinishContext();
15619 0 : return __pyx_r;
15620 : }
15621 :
15622 : /* "(tree fragment)":3
15623 : * def __reduce_cython__(self):
15624 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15625 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15626 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15627 : */
15628 :
15629 : /* Python wrapper */
15630 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15631 : #if CYTHON_METH_FASTCALL
15632 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15633 : #else
15634 : PyObject *__pyx_args, PyObject *__pyx_kwds
15635 : #endif
15636 : ); /*proto*/
15637 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
15638 : #if CYTHON_METH_FASTCALL
15639 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
15640 : #else
15641 : PyObject *__pyx_args, PyObject *__pyx_kwds
15642 : #endif
15643 : ) {
15644 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
15645 : #if !CYTHON_METH_FASTCALL
15646 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
15647 : #endif
15648 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
15649 0 : PyObject* values[1] = {0};
15650 0 : int __pyx_lineno = 0;
15651 0 : const char *__pyx_filename = NULL;
15652 0 : int __pyx_clineno = 0;
15653 0 : PyObject *__pyx_r = 0;
15654 : __Pyx_RefNannyDeclarations
15655 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15656 : #if !CYTHON_METH_FASTCALL
15657 : #if CYTHON_ASSUME_SAFE_MACROS
15658 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
15659 : #else
15660 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
15661 : #endif
15662 : #endif
15663 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
15664 0 : {
15665 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
15666 0 : if (__pyx_kwds) {
15667 0 : Py_ssize_t kw_args;
15668 0 : switch (__pyx_nargs) {
15669 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
15670 0 : CYTHON_FALLTHROUGH;
15671 0 : case 0: break;
15672 0 : default: goto __pyx_L5_argtuple_error;
15673 : }
15674 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
15675 0 : switch (__pyx_nargs) {
15676 0 : case 0:
15677 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
15678 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
15679 0 : kw_args--;
15680 : }
15681 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
15682 0 : else goto __pyx_L5_argtuple_error;
15683 : }
15684 0 : if (unlikely(kw_args > 0)) {
15685 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
15686 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
15687 : }
15688 0 : } else if (unlikely(__pyx_nargs != 1)) {
15689 0 : goto __pyx_L5_argtuple_error;
15690 : } else {
15691 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
15692 : }
15693 0 : __pyx_v___pyx_state = values[0];
15694 : }
15695 0 : goto __pyx_L6_skip;
15696 0 : __pyx_L5_argtuple_error:;
15697 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
15698 0 : __pyx_L6_skip:;
15699 0 : goto __pyx_L4_argument_unpacking_done;
15700 0 : __pyx_L3_error:;
15701 0 : {
15702 0 : Py_ssize_t __pyx_temp;
15703 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15704 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
15705 : }
15706 : }
15707 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15708 : __Pyx_RefNannyFinishContext();
15709 : return NULL;
15710 0 : __pyx_L4_argument_unpacking_done:;
15711 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
15712 :
15713 : /* function exit code */
15714 : {
15715 : Py_ssize_t __pyx_temp;
15716 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
15717 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
15718 : }
15719 : }
15720 : __Pyx_RefNannyFinishContext();
15721 : return __pyx_r;
15722 : }
15723 :
15724 0 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
15725 0 : PyObject *__pyx_r = NULL;
15726 : __Pyx_RefNannyDeclarations
15727 0 : int __pyx_lineno = 0;
15728 0 : const char *__pyx_filename = NULL;
15729 0 : int __pyx_clineno = 0;
15730 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
15731 :
15732 : /* "(tree fragment)":4
15733 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15734 : * def __setstate_cython__(self, __pyx_state):
15735 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
15736 : */
15737 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
15738 0 : __PYX_ERR(1, 4, __pyx_L1_error)
15739 :
15740 : /* "(tree fragment)":3
15741 : * def __reduce_cython__(self):
15742 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15743 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15744 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
15745 : */
15746 :
15747 : /* function exit code */
15748 0 : __pyx_L1_error:;
15749 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15750 0 : __pyx_r = NULL;
15751 0 : __Pyx_XGIVEREF(__pyx_r);
15752 0 : __Pyx_RefNannyFinishContext();
15753 0 : return __pyx_r;
15754 : }
15755 :
15756 : /* "View.MemoryView":999
15757 : *
15758 : * @cname('__pyx_memoryview_fromslice')
15759 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15760 : * int ndim,
15761 : * object (*to_object_func)(char *),
15762 : */
15763 :
15764 2484 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
15765 2484 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
15766 2484 : Py_ssize_t __pyx_v_suboffset;
15767 2484 : PyObject *__pyx_v_length = NULL;
15768 2484 : PyObject *__pyx_r = NULL;
15769 : __Pyx_RefNannyDeclarations
15770 2484 : int __pyx_t_1;
15771 2484 : PyObject *__pyx_t_2 = NULL;
15772 2484 : PyObject *__pyx_t_3 = NULL;
15773 2484 : __Pyx_TypeInfo *__pyx_t_4;
15774 2484 : Py_buffer __pyx_t_5;
15775 2484 : Py_ssize_t *__pyx_t_6;
15776 2484 : Py_ssize_t *__pyx_t_7;
15777 2484 : Py_ssize_t *__pyx_t_8;
15778 2484 : Py_ssize_t __pyx_t_9;
15779 2484 : int __pyx_lineno = 0;
15780 2484 : const char *__pyx_filename = NULL;
15781 2484 : int __pyx_clineno = 0;
15782 2484 : __Pyx_RefNannySetupContext("memoryview_fromslice", 1);
15783 :
15784 : /* "View.MemoryView":1007
15785 : * cdef _memoryviewslice result
15786 : *
15787 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15788 : * return None
15789 : *
15790 : */
15791 2484 : __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
15792 2484 : if (__pyx_t_1) {
15793 :
15794 : /* "View.MemoryView":1008
15795 : *
15796 : * if <PyObject *> memviewslice.memview == Py_None:
15797 : * return None # <<<<<<<<<<<<<<
15798 : *
15799 : *
15800 : */
15801 0 : __Pyx_XDECREF(__pyx_r);
15802 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15803 0 : goto __pyx_L0;
15804 :
15805 : /* "View.MemoryView":1007
15806 : * cdef _memoryviewslice result
15807 : *
15808 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
15809 : * return None
15810 : *
15811 : */
15812 : }
15813 :
15814 : /* "View.MemoryView":1013
15815 : *
15816 : *
15817 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
15818 : *
15819 : * result.from_slice = memviewslice
15820 : */
15821 2484 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
15822 2484 : __Pyx_GOTREF(__pyx_t_2);
15823 2484 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
15824 2484 : __Pyx_GOTREF(__pyx_t_3);
15825 2484 : __Pyx_INCREF(Py_None);
15826 2484 : __Pyx_GIVEREF(Py_None);
15827 2484 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(1, 1013, __pyx_L1_error);
15828 2484 : __Pyx_INCREF(__pyx_int_0);
15829 2484 : __Pyx_GIVEREF(__pyx_int_0);
15830 2484 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(1, 1013, __pyx_L1_error);
15831 2484 : __Pyx_GIVEREF(__pyx_t_2);
15832 2484 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error);
15833 2484 : __pyx_t_2 = 0;
15834 2484 : __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
15835 2484 : __Pyx_GOTREF((PyObject *)__pyx_t_2);
15836 2484 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15837 2484 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15838 2484 : __pyx_t_2 = 0;
15839 :
15840 : /* "View.MemoryView":1015
15841 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
15842 : *
15843 : * result.from_slice = memviewslice # <<<<<<<<<<<<<<
15844 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
15845 : *
15846 : */
15847 2484 : __pyx_v_result->from_slice = __pyx_v_memviewslice;
15848 :
15849 : /* "View.MemoryView":1016
15850 : *
15851 : * result.from_slice = memviewslice
15852 : * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
15853 : *
15854 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15855 : */
15856 2484 : __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
15857 :
15858 : /* "View.MemoryView":1018
15859 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
15860 : *
15861 : * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
15862 : * result.typeinfo = memviewslice.memview.typeinfo
15863 : *
15864 : */
15865 2484 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
15866 2484 : __Pyx_GOTREF(__pyx_t_2);
15867 2484 : __Pyx_GIVEREF(__pyx_t_2);
15868 2484 : __Pyx_GOTREF(__pyx_v_result->from_object);
15869 2484 : __Pyx_DECREF(__pyx_v_result->from_object);
15870 2484 : __pyx_v_result->from_object = __pyx_t_2;
15871 2484 : __pyx_t_2 = 0;
15872 :
15873 : /* "View.MemoryView":1019
15874 : *
15875 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
15876 : * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
15877 : *
15878 : * result.view = memviewslice.memview.view
15879 : */
15880 2484 : __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
15881 2484 : __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
15882 :
15883 : /* "View.MemoryView":1021
15884 : * result.typeinfo = memviewslice.memview.typeinfo
15885 : *
15886 : * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
15887 : * result.view.buf = <void *> memviewslice.data
15888 : * result.view.ndim = ndim
15889 : */
15890 2484 : __pyx_t_5 = __pyx_v_memviewslice.memview->view;
15891 2484 : __pyx_v_result->__pyx_base.view = __pyx_t_5;
15892 :
15893 : /* "View.MemoryView":1022
15894 : *
15895 : * result.view = memviewslice.memview.view
15896 : * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
15897 : * result.view.ndim = ndim
15898 : * (<__pyx_buffer *> &result.view).obj = Py_None
15899 : */
15900 2484 : __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
15901 :
15902 : /* "View.MemoryView":1023
15903 : * result.view = memviewslice.memview.view
15904 : * result.view.buf = <void *> memviewslice.data
15905 : * result.view.ndim = ndim # <<<<<<<<<<<<<<
15906 : * (<__pyx_buffer *> &result.view).obj = Py_None
15907 : * Py_INCREF(Py_None)
15908 : */
15909 2484 : __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
15910 :
15911 : /* "View.MemoryView":1024
15912 : * result.view.buf = <void *> memviewslice.data
15913 : * result.view.ndim = ndim
15914 : * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
15915 : * Py_INCREF(Py_None)
15916 : *
15917 : */
15918 2484 : ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
15919 :
15920 : /* "View.MemoryView":1025
15921 : * result.view.ndim = ndim
15922 : * (<__pyx_buffer *> &result.view).obj = Py_None
15923 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15924 : *
15925 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15926 : */
15927 2484 : Py_INCREF(Py_None);
15928 :
15929 : /* "View.MemoryView":1027
15930 : * Py_INCREF(Py_None)
15931 : *
15932 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15933 : * result.flags = PyBUF_RECORDS
15934 : * else:
15935 : */
15936 2484 : __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15937 2484 : if (__pyx_t_1) {
15938 :
15939 : /* "View.MemoryView":1028
15940 : *
15941 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15942 : * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15943 : * else:
15944 : * result.flags = PyBUF_RECORDS_RO
15945 : */
15946 1366 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15947 :
15948 : /* "View.MemoryView":1027
15949 : * Py_INCREF(Py_None)
15950 : *
15951 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15952 : * result.flags = PyBUF_RECORDS
15953 : * else:
15954 : */
15955 1366 : goto __pyx_L4;
15956 : }
15957 :
15958 : /* "View.MemoryView":1030
15959 : * result.flags = PyBUF_RECORDS
15960 : * else:
15961 : * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15962 : *
15963 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15964 : */
15965 1118 : /*else*/ {
15966 1118 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15967 : }
15968 2484 : __pyx_L4:;
15969 :
15970 : /* "View.MemoryView":1032
15971 : * result.flags = PyBUF_RECORDS_RO
15972 : *
15973 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15974 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15975 : *
15976 : */
15977 2484 : __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15978 :
15979 : /* "View.MemoryView":1033
15980 : *
15981 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15982 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15983 : *
15984 : *
15985 : */
15986 2484 : __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15987 :
15988 : /* "View.MemoryView":1036
15989 : *
15990 : *
15991 : * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15992 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15993 : * if suboffset >= 0:
15994 : */
15995 2484 : __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15996 :
15997 : /* "View.MemoryView":1037
15998 : *
15999 : * result.view.suboffsets = NULL
16000 : * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
16001 : * if suboffset >= 0:
16002 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16003 : */
16004 2484 : __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
16005 6090 : for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16006 3606 : __pyx_t_6 = __pyx_t_8;
16007 3606 : __pyx_v_suboffset = (__pyx_t_6[0]);
16008 :
16009 : /* "View.MemoryView":1038
16010 : * result.view.suboffsets = NULL
16011 : * for suboffset in result.from_slice.suboffsets[:ndim]:
16012 : * if suboffset >= 0: # <<<<<<<<<<<<<<
16013 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16014 : * break
16015 : */
16016 3606 : __pyx_t_1 = (__pyx_v_suboffset >= 0);
16017 3606 : if (__pyx_t_1) {
16018 :
16019 : /* "View.MemoryView":1039
16020 : * for suboffset in result.from_slice.suboffsets[:ndim]:
16021 : * if suboffset >= 0:
16022 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
16023 : * break
16024 : *
16025 : */
16026 0 : __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
16027 :
16028 : /* "View.MemoryView":1040
16029 : * if suboffset >= 0:
16030 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16031 : * break # <<<<<<<<<<<<<<
16032 : *
16033 : * result.view.len = result.view.itemsize
16034 : */
16035 0 : goto __pyx_L6_break;
16036 :
16037 : /* "View.MemoryView":1038
16038 : * result.view.suboffsets = NULL
16039 : * for suboffset in result.from_slice.suboffsets[:ndim]:
16040 : * if suboffset >= 0: # <<<<<<<<<<<<<<
16041 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
16042 : * break
16043 : */
16044 : }
16045 : }
16046 2484 : __pyx_L6_break:;
16047 :
16048 : /* "View.MemoryView":1042
16049 : * break
16050 : *
16051 : * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
16052 : * for length in result.view.shape[:ndim]:
16053 : * result.view.len *= length
16054 : */
16055 2484 : __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
16056 2484 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16057 :
16058 : /* "View.MemoryView":1043
16059 : *
16060 : * result.view.len = result.view.itemsize
16061 : * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
16062 : * result.view.len *= length
16063 : *
16064 : */
16065 2484 : __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
16066 6090 : for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
16067 3606 : __pyx_t_6 = __pyx_t_8;
16068 3606 : __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
16069 3606 : __Pyx_GOTREF(__pyx_t_2);
16070 3606 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
16071 3606 : __pyx_t_2 = 0;
16072 :
16073 : /* "View.MemoryView":1044
16074 : * result.view.len = result.view.itemsize
16075 : * for length in result.view.shape[:ndim]:
16076 : * result.view.len *= length # <<<<<<<<<<<<<<
16077 : *
16078 : * result.to_object_func = to_object_func
16079 : */
16080 3606 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
16081 3606 : __Pyx_GOTREF(__pyx_t_2);
16082 3606 : __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
16083 3606 : __Pyx_GOTREF(__pyx_t_3);
16084 3606 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16085 3606 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
16086 3606 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16087 3606 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
16088 : }
16089 :
16090 : /* "View.MemoryView":1046
16091 : * result.view.len *= length
16092 : *
16093 : * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
16094 : * result.to_dtype_func = to_dtype_func
16095 : *
16096 : */
16097 2484 : __pyx_v_result->to_object_func = __pyx_v_to_object_func;
16098 :
16099 : /* "View.MemoryView":1047
16100 : *
16101 : * result.to_object_func = to_object_func
16102 : * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
16103 : *
16104 : * return result
16105 : */
16106 2484 : __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
16107 :
16108 : /* "View.MemoryView":1049
16109 : * result.to_dtype_func = to_dtype_func
16110 : *
16111 : * return result # <<<<<<<<<<<<<<
16112 : *
16113 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
16114 : */
16115 2484 : __Pyx_XDECREF(__pyx_r);
16116 2484 : __Pyx_INCREF((PyObject *)__pyx_v_result);
16117 2484 : __pyx_r = ((PyObject *)__pyx_v_result);
16118 2484 : goto __pyx_L0;
16119 :
16120 : /* "View.MemoryView":999
16121 : *
16122 : * @cname('__pyx_memoryview_fromslice')
16123 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16124 : * int ndim,
16125 : * object (*to_object_func)(char *),
16126 : */
16127 :
16128 : /* function exit code */
16129 0 : __pyx_L1_error:;
16130 0 : __Pyx_XDECREF(__pyx_t_2);
16131 0 : __Pyx_XDECREF(__pyx_t_3);
16132 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16133 : __pyx_r = 0;
16134 2484 : __pyx_L0:;
16135 2484 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
16136 2484 : __Pyx_XDECREF(__pyx_v_length);
16137 2484 : __Pyx_XGIVEREF(__pyx_r);
16138 2484 : __Pyx_RefNannyFinishContext();
16139 2484 : return __pyx_r;
16140 : }
16141 :
16142 : /* "View.MemoryView":1052
16143 : *
16144 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
16145 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16146 : * __Pyx_memviewslice *mslice) except NULL:
16147 : * cdef _memoryviewslice obj
16148 : */
16149 :
16150 0 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
16151 0 : struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
16152 0 : __Pyx_memviewslice *__pyx_r;
16153 : __Pyx_RefNannyDeclarations
16154 0 : int __pyx_t_1;
16155 0 : PyObject *__pyx_t_2 = NULL;
16156 0 : int __pyx_lineno = 0;
16157 0 : const char *__pyx_filename = NULL;
16158 0 : int __pyx_clineno = 0;
16159 0 : __Pyx_RefNannySetupContext("get_slice_from_memview", 1);
16160 :
16161 : /* "View.MemoryView":1055
16162 : * __Pyx_memviewslice *mslice) except NULL:
16163 : * cdef _memoryviewslice obj
16164 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16165 : * obj = memview
16166 : * return &obj.from_slice
16167 : */
16168 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16169 0 : if (__pyx_t_1) {
16170 :
16171 : /* "View.MemoryView":1056
16172 : * cdef _memoryviewslice obj
16173 : * if isinstance(memview, _memoryviewslice):
16174 : * obj = memview # <<<<<<<<<<<<<<
16175 : * return &obj.from_slice
16176 : * else:
16177 : */
16178 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
16179 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
16180 0 : __Pyx_INCREF(__pyx_t_2);
16181 0 : __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
16182 0 : __pyx_t_2 = 0;
16183 :
16184 : /* "View.MemoryView":1057
16185 : * if isinstance(memview, _memoryviewslice):
16186 : * obj = memview
16187 : * return &obj.from_slice # <<<<<<<<<<<<<<
16188 : * else:
16189 : * slice_copy(memview, mslice)
16190 : */
16191 0 : __pyx_r = (&__pyx_v_obj->from_slice);
16192 0 : goto __pyx_L0;
16193 :
16194 : /* "View.MemoryView":1055
16195 : * __Pyx_memviewslice *mslice) except NULL:
16196 : * cdef _memoryviewslice obj
16197 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16198 : * obj = memview
16199 : * return &obj.from_slice
16200 : */
16201 : }
16202 :
16203 : /* "View.MemoryView":1059
16204 : * return &obj.from_slice
16205 : * else:
16206 : * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
16207 : * return mslice
16208 : *
16209 : */
16210 0 : /*else*/ {
16211 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
16212 :
16213 : /* "View.MemoryView":1060
16214 : * else:
16215 : * slice_copy(memview, mslice)
16216 : * return mslice # <<<<<<<<<<<<<<
16217 : *
16218 : * @cname('__pyx_memoryview_slice_copy')
16219 : */
16220 0 : __pyx_r = __pyx_v_mslice;
16221 0 : goto __pyx_L0;
16222 : }
16223 :
16224 : /* "View.MemoryView":1052
16225 : *
16226 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
16227 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
16228 : * __Pyx_memviewslice *mslice) except NULL:
16229 : * cdef _memoryviewslice obj
16230 : */
16231 :
16232 : /* function exit code */
16233 0 : __pyx_L1_error:;
16234 0 : __Pyx_XDECREF(__pyx_t_2);
16235 0 : __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
16236 0 : __pyx_r = NULL;
16237 0 : __pyx_L0:;
16238 0 : __Pyx_XDECREF((PyObject *)__pyx_v_obj);
16239 0 : __Pyx_RefNannyFinishContext();
16240 0 : return __pyx_r;
16241 : }
16242 :
16243 : /* "View.MemoryView":1063
16244 : *
16245 : * @cname('__pyx_memoryview_slice_copy')
16246 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
16247 : * cdef int dim
16248 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16249 : */
16250 :
16251 0 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
16252 0 : int __pyx_v_dim;
16253 0 : Py_ssize_t *__pyx_v_shape;
16254 0 : Py_ssize_t *__pyx_v_strides;
16255 0 : Py_ssize_t *__pyx_v_suboffsets;
16256 0 : Py_ssize_t *__pyx_t_1;
16257 0 : int __pyx_t_2;
16258 0 : int __pyx_t_3;
16259 0 : int __pyx_t_4;
16260 0 : Py_ssize_t __pyx_t_5;
16261 0 : int __pyx_t_6;
16262 :
16263 : /* "View.MemoryView":1067
16264 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16265 : *
16266 : * shape = memview.view.shape # <<<<<<<<<<<<<<
16267 : * strides = memview.view.strides
16268 : * suboffsets = memview.view.suboffsets
16269 : */
16270 0 : __pyx_t_1 = __pyx_v_memview->view.shape;
16271 0 : __pyx_v_shape = __pyx_t_1;
16272 :
16273 : /* "View.MemoryView":1068
16274 : *
16275 : * shape = memview.view.shape
16276 : * strides = memview.view.strides # <<<<<<<<<<<<<<
16277 : * suboffsets = memview.view.suboffsets
16278 : *
16279 : */
16280 0 : __pyx_t_1 = __pyx_v_memview->view.strides;
16281 0 : __pyx_v_strides = __pyx_t_1;
16282 :
16283 : /* "View.MemoryView":1069
16284 : * shape = memview.view.shape
16285 : * strides = memview.view.strides
16286 : * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
16287 : *
16288 : * dst.memview = <__pyx_memoryview *> memview
16289 : */
16290 0 : __pyx_t_1 = __pyx_v_memview->view.suboffsets;
16291 0 : __pyx_v_suboffsets = __pyx_t_1;
16292 :
16293 : /* "View.MemoryView":1071
16294 : * suboffsets = memview.view.suboffsets
16295 : *
16296 : * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
16297 : * dst.data = <char *> memview.view.buf
16298 : *
16299 : */
16300 0 : __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
16301 :
16302 : /* "View.MemoryView":1072
16303 : *
16304 : * dst.memview = <__pyx_memoryview *> memview
16305 : * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
16306 : *
16307 : * for dim in range(memview.view.ndim):
16308 : */
16309 0 : __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
16310 :
16311 : /* "View.MemoryView":1074
16312 : * dst.data = <char *> memview.view.buf
16313 : *
16314 : * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
16315 : * dst.shape[dim] = shape[dim]
16316 : * dst.strides[dim] = strides[dim]
16317 : */
16318 0 : __pyx_t_2 = __pyx_v_memview->view.ndim;
16319 0 : __pyx_t_3 = __pyx_t_2;
16320 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16321 0 : __pyx_v_dim = __pyx_t_4;
16322 :
16323 : /* "View.MemoryView":1075
16324 : *
16325 : * for dim in range(memview.view.ndim):
16326 : * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
16327 : * dst.strides[dim] = strides[dim]
16328 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16329 : */
16330 0 : (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
16331 :
16332 : /* "View.MemoryView":1076
16333 : * for dim in range(memview.view.ndim):
16334 : * dst.shape[dim] = shape[dim]
16335 : * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
16336 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
16337 : *
16338 : */
16339 0 : (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
16340 :
16341 : /* "View.MemoryView":1077
16342 : * dst.shape[dim] = shape[dim]
16343 : * dst.strides[dim] = strides[dim]
16344 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
16345 : *
16346 : * @cname('__pyx_memoryview_copy_object')
16347 : */
16348 0 : __pyx_t_6 = (__pyx_v_suboffsets != 0);
16349 0 : if (__pyx_t_6) {
16350 0 : __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
16351 : } else {
16352 : __pyx_t_5 = -1L;
16353 : }
16354 0 : (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
16355 : }
16356 :
16357 : /* "View.MemoryView":1063
16358 : *
16359 : * @cname('__pyx_memoryview_slice_copy')
16360 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
16361 : * cdef int dim
16362 : * cdef (Py_ssize_t*) shape, strides, suboffsets
16363 : */
16364 :
16365 : /* function exit code */
16366 0 : }
16367 :
16368 : /* "View.MemoryView":1080
16369 : *
16370 : * @cname('__pyx_memoryview_copy_object')
16371 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16372 : * "Create a new memoryview object"
16373 : * cdef __Pyx_memviewslice memviewslice
16374 : */
16375 :
16376 0 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
16377 0 : __Pyx_memviewslice __pyx_v_memviewslice;
16378 0 : PyObject *__pyx_r = NULL;
16379 : __Pyx_RefNannyDeclarations
16380 0 : PyObject *__pyx_t_1 = NULL;
16381 0 : int __pyx_lineno = 0;
16382 0 : const char *__pyx_filename = NULL;
16383 0 : int __pyx_clineno = 0;
16384 0 : __Pyx_RefNannySetupContext("memoryview_copy", 1);
16385 :
16386 : /* "View.MemoryView":1083
16387 : * "Create a new memoryview object"
16388 : * cdef __Pyx_memviewslice memviewslice
16389 : * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
16390 : * return memoryview_copy_from_slice(memview, &memviewslice)
16391 : *
16392 : */
16393 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
16394 :
16395 : /* "View.MemoryView":1084
16396 : * cdef __Pyx_memviewslice memviewslice
16397 : * slice_copy(memview, &memviewslice)
16398 : * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
16399 : *
16400 : * @cname('__pyx_memoryview_copy_object_from_slice')
16401 : */
16402 0 : __Pyx_XDECREF(__pyx_r);
16403 0 : __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
16404 0 : __Pyx_GOTREF(__pyx_t_1);
16405 0 : __pyx_r = __pyx_t_1;
16406 0 : __pyx_t_1 = 0;
16407 0 : goto __pyx_L0;
16408 :
16409 : /* "View.MemoryView":1080
16410 : *
16411 : * @cname('__pyx_memoryview_copy_object')
16412 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
16413 : * "Create a new memoryview object"
16414 : * cdef __Pyx_memviewslice memviewslice
16415 : */
16416 :
16417 : /* function exit code */
16418 0 : __pyx_L1_error:;
16419 0 : __Pyx_XDECREF(__pyx_t_1);
16420 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
16421 : __pyx_r = 0;
16422 0 : __pyx_L0:;
16423 0 : __Pyx_XGIVEREF(__pyx_r);
16424 0 : __Pyx_RefNannyFinishContext();
16425 0 : return __pyx_r;
16426 : }
16427 :
16428 : /* "View.MemoryView":1087
16429 : *
16430 : * @cname('__pyx_memoryview_copy_object_from_slice')
16431 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
16432 : * """
16433 : * Create a new memoryview object from a given memoryview object and slice.
16434 : */
16435 :
16436 0 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
16437 0 : PyObject *(*__pyx_v_to_object_func)(char *);
16438 0 : int (*__pyx_v_to_dtype_func)(char *, PyObject *);
16439 0 : PyObject *__pyx_r = NULL;
16440 : __Pyx_RefNannyDeclarations
16441 0 : int __pyx_t_1;
16442 0 : PyObject *(*__pyx_t_2)(char *);
16443 0 : int (*__pyx_t_3)(char *, PyObject *);
16444 0 : PyObject *__pyx_t_4 = NULL;
16445 0 : int __pyx_lineno = 0;
16446 0 : const char *__pyx_filename = NULL;
16447 0 : int __pyx_clineno = 0;
16448 0 : __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1);
16449 :
16450 : /* "View.MemoryView":1094
16451 : * cdef int (*to_dtype_func)(char *, object) except 0
16452 : *
16453 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16454 : * to_object_func = (<_memoryviewslice> memview).to_object_func
16455 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16456 : */
16457 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
16458 0 : if (__pyx_t_1) {
16459 :
16460 : /* "View.MemoryView":1095
16461 : *
16462 : * if isinstance(memview, _memoryviewslice):
16463 : * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
16464 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16465 : * else:
16466 : */
16467 0 : __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
16468 0 : __pyx_v_to_object_func = __pyx_t_2;
16469 :
16470 : /* "View.MemoryView":1096
16471 : * if isinstance(memview, _memoryviewslice):
16472 : * to_object_func = (<_memoryviewslice> memview).to_object_func
16473 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
16474 : * else:
16475 : * to_object_func = NULL
16476 : */
16477 0 : __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
16478 0 : __pyx_v_to_dtype_func = __pyx_t_3;
16479 :
16480 : /* "View.MemoryView":1094
16481 : * cdef int (*to_dtype_func)(char *, object) except 0
16482 : *
16483 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
16484 : * to_object_func = (<_memoryviewslice> memview).to_object_func
16485 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16486 : */
16487 0 : goto __pyx_L3;
16488 : }
16489 :
16490 : /* "View.MemoryView":1098
16491 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
16492 : * else:
16493 : * to_object_func = NULL # <<<<<<<<<<<<<<
16494 : * to_dtype_func = NULL
16495 : *
16496 : */
16497 : /*else*/ {
16498 : __pyx_v_to_object_func = NULL;
16499 :
16500 : /* "View.MemoryView":1099
16501 : * else:
16502 : * to_object_func = NULL
16503 : * to_dtype_func = NULL # <<<<<<<<<<<<<<
16504 : *
16505 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16506 : */
16507 : __pyx_v_to_dtype_func = NULL;
16508 : }
16509 0 : __pyx_L3:;
16510 :
16511 : /* "View.MemoryView":1101
16512 : * to_dtype_func = NULL
16513 : *
16514 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
16515 : * to_object_func, to_dtype_func,
16516 : * memview.dtype_is_object)
16517 : */
16518 0 : __Pyx_XDECREF(__pyx_r);
16519 :
16520 : /* "View.MemoryView":1103
16521 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
16522 : * to_object_func, to_dtype_func,
16523 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
16524 : *
16525 : *
16526 : */
16527 0 : __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
16528 0 : __Pyx_GOTREF(__pyx_t_4);
16529 0 : __pyx_r = __pyx_t_4;
16530 0 : __pyx_t_4 = 0;
16531 0 : goto __pyx_L0;
16532 :
16533 : /* "View.MemoryView":1087
16534 : *
16535 : * @cname('__pyx_memoryview_copy_object_from_slice')
16536 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
16537 : * """
16538 : * Create a new memoryview object from a given memoryview object and slice.
16539 : */
16540 :
16541 : /* function exit code */
16542 0 : __pyx_L1_error:;
16543 0 : __Pyx_XDECREF(__pyx_t_4);
16544 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16545 0 : __pyx_r = 0;
16546 0 : __pyx_L0:;
16547 0 : __Pyx_XGIVEREF(__pyx_r);
16548 0 : __Pyx_RefNannyFinishContext();
16549 0 : return __pyx_r;
16550 : }
16551 :
16552 : /* "View.MemoryView":1109
16553 : *
16554 : *
16555 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16556 : * return -arg if arg < 0 else arg
16557 : *
16558 : */
16559 :
16560 3285054 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
16561 3285054 : Py_ssize_t __pyx_r;
16562 3285054 : Py_ssize_t __pyx_t_1;
16563 3285054 : int __pyx_t_2;
16564 :
16565 : /* "View.MemoryView":1110
16566 : *
16567 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
16568 : * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
16569 : *
16570 : * @cname('__pyx_get_best_slice_order')
16571 : */
16572 3285054 : __pyx_t_2 = (__pyx_v_arg < 0);
16573 3285054 : if (__pyx_t_2) {
16574 : __pyx_t_1 = (-__pyx_v_arg);
16575 : } else {
16576 : __pyx_t_1 = __pyx_v_arg;
16577 : }
16578 3285054 : __pyx_r = __pyx_t_1;
16579 3285054 : goto __pyx_L0;
16580 :
16581 : /* "View.MemoryView":1109
16582 : *
16583 : *
16584 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
16585 : * return -arg if arg < 0 else arg
16586 : *
16587 : */
16588 :
16589 : /* function exit code */
16590 3285054 : __pyx_L0:;
16591 3285054 : return __pyx_r;
16592 : }
16593 :
16594 : /* "View.MemoryView":1113
16595 : *
16596 : * @cname('__pyx_get_best_slice_order')
16597 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16598 : * """
16599 : * Figure out the best memory access order for a given slice.
16600 : */
16601 :
16602 3285054 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
16603 3285054 : int __pyx_v_i;
16604 3285054 : Py_ssize_t __pyx_v_c_stride;
16605 3285054 : Py_ssize_t __pyx_v_f_stride;
16606 3285054 : char __pyx_r;
16607 3285054 : int __pyx_t_1;
16608 3285054 : int __pyx_t_2;
16609 3285054 : int __pyx_t_3;
16610 3285054 : int __pyx_t_4;
16611 :
16612 : /* "View.MemoryView":1118
16613 : * """
16614 : * cdef int i
16615 : * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
16616 : * cdef Py_ssize_t f_stride = 0
16617 : *
16618 : */
16619 3285054 : __pyx_v_c_stride = 0;
16620 :
16621 : /* "View.MemoryView":1119
16622 : * cdef int i
16623 : * cdef Py_ssize_t c_stride = 0
16624 : * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
16625 : *
16626 : * for i in range(ndim - 1, -1, -1):
16627 : */
16628 3285054 : __pyx_v_f_stride = 0;
16629 :
16630 : /* "View.MemoryView":1121
16631 : * cdef Py_ssize_t f_stride = 0
16632 : *
16633 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16634 : * if mslice.shape[i] > 1:
16635 : * c_stride = mslice.strides[i]
16636 : */
16637 3285054 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
16638 3285054 : __pyx_v_i = __pyx_t_1;
16639 :
16640 : /* "View.MemoryView":1122
16641 : *
16642 : * for i in range(ndim - 1, -1, -1):
16643 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16644 : * c_stride = mslice.strides[i]
16645 : * break
16646 : */
16647 3285054 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16648 3285054 : if (__pyx_t_2) {
16649 :
16650 : /* "View.MemoryView":1123
16651 : * for i in range(ndim - 1, -1, -1):
16652 : * if mslice.shape[i] > 1:
16653 : * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16654 : * break
16655 : *
16656 : */
16657 3285054 : __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16658 :
16659 : /* "View.MemoryView":1124
16660 : * if mslice.shape[i] > 1:
16661 : * c_stride = mslice.strides[i]
16662 : * break # <<<<<<<<<<<<<<
16663 : *
16664 : * for i in range(ndim):
16665 : */
16666 3285054 : goto __pyx_L4_break;
16667 :
16668 : /* "View.MemoryView":1122
16669 : *
16670 : * for i in range(ndim - 1, -1, -1):
16671 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16672 : * c_stride = mslice.strides[i]
16673 : * break
16674 : */
16675 : }
16676 : }
16677 0 : __pyx_L4_break:;
16678 :
16679 : /* "View.MemoryView":1126
16680 : * break
16681 : *
16682 : * for i in range(ndim): # <<<<<<<<<<<<<<
16683 : * if mslice.shape[i] > 1:
16684 : * f_stride = mslice.strides[i]
16685 : */
16686 3285054 : __pyx_t_1 = __pyx_v_ndim;
16687 3285054 : __pyx_t_3 = __pyx_t_1;
16688 3285054 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16689 3285054 : __pyx_v_i = __pyx_t_4;
16690 :
16691 : /* "View.MemoryView":1127
16692 : *
16693 : * for i in range(ndim):
16694 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16695 : * f_stride = mslice.strides[i]
16696 : * break
16697 : */
16698 3285054 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
16699 3285054 : if (__pyx_t_2) {
16700 :
16701 : /* "View.MemoryView":1128
16702 : * for i in range(ndim):
16703 : * if mslice.shape[i] > 1:
16704 : * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
16705 : * break
16706 : *
16707 : */
16708 3285054 : __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
16709 :
16710 : /* "View.MemoryView":1129
16711 : * if mslice.shape[i] > 1:
16712 : * f_stride = mslice.strides[i]
16713 : * break # <<<<<<<<<<<<<<
16714 : *
16715 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16716 : */
16717 3285054 : goto __pyx_L7_break;
16718 :
16719 : /* "View.MemoryView":1127
16720 : *
16721 : * for i in range(ndim):
16722 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
16723 : * f_stride = mslice.strides[i]
16724 : * break
16725 : */
16726 : }
16727 : }
16728 0 : __pyx_L7_break:;
16729 :
16730 : /* "View.MemoryView":1131
16731 : * break
16732 : *
16733 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16734 : * return 'C'
16735 : * else:
16736 : */
16737 3285054 : __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
16738 3285054 : if (__pyx_t_2) {
16739 :
16740 : /* "View.MemoryView":1132
16741 : *
16742 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
16743 : * return 'C' # <<<<<<<<<<<<<<
16744 : * else:
16745 : * return 'F'
16746 : */
16747 3285054 : __pyx_r = 'C';
16748 3285054 : goto __pyx_L0;
16749 :
16750 : /* "View.MemoryView":1131
16751 : * break
16752 : *
16753 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
16754 : * return 'C'
16755 : * else:
16756 : */
16757 : }
16758 :
16759 : /* "View.MemoryView":1134
16760 : * return 'C'
16761 : * else:
16762 : * return 'F' # <<<<<<<<<<<<<<
16763 : *
16764 : * @cython.cdivision(True)
16765 : */
16766 0 : /*else*/ {
16767 0 : __pyx_r = 'F';
16768 0 : goto __pyx_L0;
16769 : }
16770 :
16771 : /* "View.MemoryView":1113
16772 : *
16773 : * @cname('__pyx_get_best_slice_order')
16774 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16775 : * """
16776 : * Figure out the best memory access order for a given slice.
16777 : */
16778 :
16779 : /* function exit code */
16780 3285054 : __pyx_L0:;
16781 3285054 : return __pyx_r;
16782 : }
16783 :
16784 : /* "View.MemoryView":1137
16785 : *
16786 : * @cython.cdivision(True)
16787 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16788 : * char *dst_data, Py_ssize_t *dst_strides,
16789 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16790 : */
16791 :
16792 0 : static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16793 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
16794 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
16795 0 : Py_ssize_t __pyx_v_dst_extent;
16796 0 : Py_ssize_t __pyx_v_src_stride;
16797 0 : Py_ssize_t __pyx_v_dst_stride;
16798 0 : int __pyx_t_1;
16799 0 : int __pyx_t_2;
16800 0 : Py_ssize_t __pyx_t_3;
16801 0 : Py_ssize_t __pyx_t_4;
16802 0 : Py_ssize_t __pyx_t_5;
16803 :
16804 : /* "View.MemoryView":1144
16805 : *
16806 : * cdef Py_ssize_t i
16807 : * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
16808 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16809 : * cdef Py_ssize_t src_stride = src_strides[0]
16810 : */
16811 0 : __pyx_v_src_extent = (__pyx_v_src_shape[0]);
16812 :
16813 : /* "View.MemoryView":1145
16814 : * cdef Py_ssize_t i
16815 : * cdef Py_ssize_t src_extent = src_shape[0]
16816 : * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
16817 : * cdef Py_ssize_t src_stride = src_strides[0]
16818 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16819 : */
16820 0 : __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
16821 :
16822 : /* "View.MemoryView":1146
16823 : * cdef Py_ssize_t src_extent = src_shape[0]
16824 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16825 : * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
16826 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16827 : *
16828 : */
16829 0 : __pyx_v_src_stride = (__pyx_v_src_strides[0]);
16830 :
16831 : /* "View.MemoryView":1147
16832 : * cdef Py_ssize_t dst_extent = dst_shape[0]
16833 : * cdef Py_ssize_t src_stride = src_strides[0]
16834 : * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
16835 : *
16836 : * if ndim == 1:
16837 : */
16838 0 : __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
16839 :
16840 : /* "View.MemoryView":1149
16841 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16842 : *
16843 : * if ndim == 1: # <<<<<<<<<<<<<<
16844 : * if (src_stride > 0 and dst_stride > 0 and
16845 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16846 : */
16847 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
16848 0 : if (__pyx_t_1) {
16849 :
16850 : /* "View.MemoryView":1150
16851 : *
16852 : * if ndim == 1:
16853 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16854 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16855 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16856 : */
16857 0 : __pyx_t_2 = (__pyx_v_src_stride > 0);
16858 0 : if (__pyx_t_2) {
16859 : } else {
16860 0 : __pyx_t_1 = __pyx_t_2;
16861 0 : goto __pyx_L5_bool_binop_done;
16862 : }
16863 0 : __pyx_t_2 = (__pyx_v_dst_stride > 0);
16864 0 : if (__pyx_t_2) {
16865 : } else {
16866 0 : __pyx_t_1 = __pyx_t_2;
16867 0 : goto __pyx_L5_bool_binop_done;
16868 : }
16869 :
16870 : /* "View.MemoryView":1151
16871 : * if ndim == 1:
16872 : * if (src_stride > 0 and dst_stride > 0 and
16873 : * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
16874 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16875 : * else:
16876 : */
16877 0 : __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
16878 0 : if (__pyx_t_2) {
16879 0 : __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
16880 : }
16881 : __pyx_t_1 = __pyx_t_2;
16882 0 : __pyx_L5_bool_binop_done:;
16883 :
16884 : /* "View.MemoryView":1150
16885 : *
16886 : * if ndim == 1:
16887 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16888 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16889 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16890 : */
16891 0 : if (__pyx_t_1) {
16892 :
16893 : /* "View.MemoryView":1152
16894 : * if (src_stride > 0 and dst_stride > 0 and
16895 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16896 : * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
16897 : * else:
16898 : * for i in range(dst_extent):
16899 : */
16900 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
16901 :
16902 : /* "View.MemoryView":1150
16903 : *
16904 : * if ndim == 1:
16905 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
16906 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16907 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16908 : */
16909 0 : goto __pyx_L4;
16910 : }
16911 :
16912 : /* "View.MemoryView":1154
16913 : * memcpy(dst_data, src_data, itemsize * dst_extent)
16914 : * else:
16915 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16916 : * memcpy(dst_data, src_data, itemsize)
16917 : * src_data += src_stride
16918 : */
16919 : /*else*/ {
16920 : __pyx_t_3 = __pyx_v_dst_extent;
16921 : __pyx_t_4 = __pyx_t_3;
16922 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16923 0 : __pyx_v_i = __pyx_t_5;
16924 :
16925 : /* "View.MemoryView":1155
16926 : * else:
16927 : * for i in range(dst_extent):
16928 : * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16929 : * src_data += src_stride
16930 : * dst_data += dst_stride
16931 : */
16932 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16933 :
16934 : /* "View.MemoryView":1156
16935 : * for i in range(dst_extent):
16936 : * memcpy(dst_data, src_data, itemsize)
16937 : * src_data += src_stride # <<<<<<<<<<<<<<
16938 : * dst_data += dst_stride
16939 : * else:
16940 : */
16941 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16942 :
16943 : /* "View.MemoryView":1157
16944 : * memcpy(dst_data, src_data, itemsize)
16945 : * src_data += src_stride
16946 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16947 : * else:
16948 : * for i in range(dst_extent):
16949 : */
16950 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16951 : }
16952 : }
16953 0 : __pyx_L4:;
16954 :
16955 : /* "View.MemoryView":1149
16956 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16957 : *
16958 : * if ndim == 1: # <<<<<<<<<<<<<<
16959 : * if (src_stride > 0 and dst_stride > 0 and
16960 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16961 : */
16962 0 : goto __pyx_L3;
16963 : }
16964 :
16965 : /* "View.MemoryView":1159
16966 : * dst_data += dst_stride
16967 : * else:
16968 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16969 : * _copy_strided_to_strided(src_data, src_strides + 1,
16970 : * dst_data, dst_strides + 1,
16971 : */
16972 : /*else*/ {
16973 : __pyx_t_3 = __pyx_v_dst_extent;
16974 : __pyx_t_4 = __pyx_t_3;
16975 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16976 0 : __pyx_v_i = __pyx_t_5;
16977 :
16978 : /* "View.MemoryView":1160
16979 : * else:
16980 : * for i in range(dst_extent):
16981 : * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16982 : * dst_data, dst_strides + 1,
16983 : * src_shape + 1, dst_shape + 1,
16984 : */
16985 0 : _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16986 :
16987 : /* "View.MemoryView":1164
16988 : * src_shape + 1, dst_shape + 1,
16989 : * ndim - 1, itemsize)
16990 : * src_data += src_stride # <<<<<<<<<<<<<<
16991 : * dst_data += dst_stride
16992 : *
16993 : */
16994 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16995 :
16996 : /* "View.MemoryView":1165
16997 : * ndim - 1, itemsize)
16998 : * src_data += src_stride
16999 : * dst_data += dst_stride # <<<<<<<<<<<<<<
17000 : *
17001 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
17002 : */
17003 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
17004 : }
17005 : }
17006 0 : __pyx_L3:;
17007 :
17008 : /* "View.MemoryView":1137
17009 : *
17010 : * @cython.cdivision(True)
17011 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
17012 : * char *dst_data, Py_ssize_t *dst_strides,
17013 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
17014 : */
17015 :
17016 : /* function exit code */
17017 0 : }
17018 :
17019 : /* "View.MemoryView":1167
17020 : * dst_data += dst_stride
17021 : *
17022 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17023 : * __Pyx_memviewslice *dst,
17024 : * int ndim, size_t itemsize) noexcept nogil:
17025 : */
17026 :
17027 0 : static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
17028 :
17029 : /* "View.MemoryView":1170
17030 : * __Pyx_memviewslice *dst,
17031 : * int ndim, size_t itemsize) noexcept nogil:
17032 : * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
17033 : * src.shape, dst.shape, ndim, itemsize)
17034 : *
17035 : */
17036 0 : _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
17037 :
17038 : /* "View.MemoryView":1167
17039 : * dst_data += dst_stride
17040 : *
17041 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17042 : * __Pyx_memviewslice *dst,
17043 : * int ndim, size_t itemsize) noexcept nogil:
17044 : */
17045 :
17046 : /* function exit code */
17047 0 : }
17048 :
17049 : /* "View.MemoryView":1174
17050 : *
17051 : * @cname('__pyx_memoryview_slice_get_size')
17052 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
17053 : * "Return the size of the memory occupied by the slice in number of bytes"
17054 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17055 : */
17056 :
17057 3285054 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
17058 3285054 : Py_ssize_t __pyx_v_shape;
17059 3285054 : Py_ssize_t __pyx_v_size;
17060 3285054 : Py_ssize_t __pyx_r;
17061 3285054 : Py_ssize_t __pyx_t_1;
17062 3285054 : Py_ssize_t *__pyx_t_2;
17063 3285054 : Py_ssize_t *__pyx_t_3;
17064 3285054 : Py_ssize_t *__pyx_t_4;
17065 :
17066 : /* "View.MemoryView":1176
17067 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
17068 : * "Return the size of the memory occupied by the slice in number of bytes"
17069 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
17070 : *
17071 : * for shape in src.shape[:ndim]:
17072 : */
17073 3285054 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17074 3285054 : __pyx_v_size = __pyx_t_1;
17075 :
17076 : /* "View.MemoryView":1178
17077 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17078 : *
17079 : * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
17080 : * size *= shape
17081 : *
17082 : */
17083 3285054 : __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
17084 6570108 : for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
17085 3285054 : __pyx_t_2 = __pyx_t_4;
17086 3285054 : __pyx_v_shape = (__pyx_t_2[0]);
17087 :
17088 : /* "View.MemoryView":1179
17089 : *
17090 : * for shape in src.shape[:ndim]:
17091 : * size *= shape # <<<<<<<<<<<<<<
17092 : *
17093 : * return size
17094 : */
17095 3285054 : __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
17096 : }
17097 :
17098 : /* "View.MemoryView":1181
17099 : * size *= shape
17100 : *
17101 : * return size # <<<<<<<<<<<<<<
17102 : *
17103 : * @cname('__pyx_fill_contig_strides_array')
17104 : */
17105 3285054 : __pyx_r = __pyx_v_size;
17106 3285054 : goto __pyx_L0;
17107 :
17108 : /* "View.MemoryView":1174
17109 : *
17110 : * @cname('__pyx_memoryview_slice_get_size')
17111 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
17112 : * "Return the size of the memory occupied by the slice in number of bytes"
17113 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
17114 : */
17115 :
17116 : /* function exit code */
17117 3285054 : __pyx_L0:;
17118 3285054 : return __pyx_r;
17119 : }
17120 :
17121 : /* "View.MemoryView":1184
17122 : *
17123 : * @cname('__pyx_fill_contig_strides_array')
17124 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17125 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17126 : * int ndim, char order) noexcept nogil:
17127 : */
17128 :
17129 0 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
17130 0 : int __pyx_v_idx;
17131 0 : Py_ssize_t __pyx_r;
17132 0 : int __pyx_t_1;
17133 0 : int __pyx_t_2;
17134 0 : int __pyx_t_3;
17135 0 : int __pyx_t_4;
17136 :
17137 : /* "View.MemoryView":1193
17138 : * cdef int idx
17139 : *
17140 : * if order == 'F': # <<<<<<<<<<<<<<
17141 : * for idx in range(ndim):
17142 : * strides[idx] = stride
17143 : */
17144 0 : __pyx_t_1 = (__pyx_v_order == 'F');
17145 0 : if (__pyx_t_1) {
17146 :
17147 : /* "View.MemoryView":1194
17148 : *
17149 : * if order == 'F':
17150 : * for idx in range(ndim): # <<<<<<<<<<<<<<
17151 : * strides[idx] = stride
17152 : * stride *= shape[idx]
17153 : */
17154 0 : __pyx_t_2 = __pyx_v_ndim;
17155 : __pyx_t_3 = __pyx_t_2;
17156 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17157 0 : __pyx_v_idx = __pyx_t_4;
17158 :
17159 : /* "View.MemoryView":1195
17160 : * if order == 'F':
17161 : * for idx in range(ndim):
17162 : * strides[idx] = stride # <<<<<<<<<<<<<<
17163 : * stride *= shape[idx]
17164 : * else:
17165 : */
17166 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17167 :
17168 : /* "View.MemoryView":1196
17169 : * for idx in range(ndim):
17170 : * strides[idx] = stride
17171 : * stride *= shape[idx] # <<<<<<<<<<<<<<
17172 : * else:
17173 : * for idx in range(ndim - 1, -1, -1):
17174 : */
17175 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17176 : }
17177 :
17178 : /* "View.MemoryView":1193
17179 : * cdef int idx
17180 : *
17181 : * if order == 'F': # <<<<<<<<<<<<<<
17182 : * for idx in range(ndim):
17183 : * strides[idx] = stride
17184 : */
17185 0 : goto __pyx_L3;
17186 : }
17187 :
17188 : /* "View.MemoryView":1198
17189 : * stride *= shape[idx]
17190 : * else:
17191 : * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17192 : * strides[idx] = stride
17193 : * stride *= shape[idx]
17194 : */
17195 0 : /*else*/ {
17196 0 : for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
17197 0 : __pyx_v_idx = __pyx_t_2;
17198 :
17199 : /* "View.MemoryView":1199
17200 : * else:
17201 : * for idx in range(ndim - 1, -1, -1):
17202 : * strides[idx] = stride # <<<<<<<<<<<<<<
17203 : * stride *= shape[idx]
17204 : *
17205 : */
17206 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
17207 :
17208 : /* "View.MemoryView":1200
17209 : * for idx in range(ndim - 1, -1, -1):
17210 : * strides[idx] = stride
17211 : * stride *= shape[idx] # <<<<<<<<<<<<<<
17212 : *
17213 : * return stride
17214 : */
17215 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
17216 : }
17217 : }
17218 0 : __pyx_L3:;
17219 :
17220 : /* "View.MemoryView":1202
17221 : * stride *= shape[idx]
17222 : *
17223 : * return stride # <<<<<<<<<<<<<<
17224 : *
17225 : * @cname('__pyx_memoryview_copy_data_to_temp')
17226 : */
17227 0 : __pyx_r = __pyx_v_stride;
17228 0 : goto __pyx_L0;
17229 :
17230 : /* "View.MemoryView":1184
17231 : *
17232 : * @cname('__pyx_fill_contig_strides_array')
17233 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
17234 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
17235 : * int ndim, char order) noexcept nogil:
17236 : */
17237 :
17238 : /* function exit code */
17239 0 : __pyx_L0:;
17240 0 : return __pyx_r;
17241 : }
17242 :
17243 : /* "View.MemoryView":1205
17244 : *
17245 : * @cname('__pyx_memoryview_copy_data_to_temp')
17246 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17247 : * __Pyx_memviewslice *tmpslice,
17248 : * char order,
17249 : */
17250 :
17251 0 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
17252 0 : int __pyx_v_i;
17253 0 : void *__pyx_v_result;
17254 0 : size_t __pyx_v_itemsize;
17255 0 : size_t __pyx_v_size;
17256 0 : void *__pyx_r;
17257 0 : Py_ssize_t __pyx_t_1;
17258 0 : int __pyx_t_2;
17259 0 : int __pyx_t_3;
17260 0 : struct __pyx_memoryview_obj *__pyx_t_4;
17261 0 : int __pyx_t_5;
17262 0 : int __pyx_t_6;
17263 0 : int __pyx_lineno = 0;
17264 0 : const char *__pyx_filename = NULL;
17265 0 : int __pyx_clineno = 0;
17266 : #ifdef WITH_THREAD
17267 0 : PyGILState_STATE __pyx_gilstate_save;
17268 : #endif
17269 :
17270 : /* "View.MemoryView":1216
17271 : * cdef void *result
17272 : *
17273 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17274 : * cdef size_t size = slice_get_size(src, ndim)
17275 : *
17276 : */
17277 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
17278 0 : __pyx_v_itemsize = __pyx_t_1;
17279 :
17280 : /* "View.MemoryView":1217
17281 : *
17282 : * cdef size_t itemsize = src.memview.view.itemsize
17283 : * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
17284 : *
17285 : * result = malloc(size)
17286 : */
17287 0 : __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
17288 :
17289 : /* "View.MemoryView":1219
17290 : * cdef size_t size = slice_get_size(src, ndim)
17291 : *
17292 : * result = malloc(size) # <<<<<<<<<<<<<<
17293 : * if not result:
17294 : * _err_no_memory()
17295 : */
17296 0 : __pyx_v_result = malloc(__pyx_v_size);
17297 :
17298 : /* "View.MemoryView":1220
17299 : *
17300 : * result = malloc(size)
17301 : * if not result: # <<<<<<<<<<<<<<
17302 : * _err_no_memory()
17303 : *
17304 : */
17305 0 : __pyx_t_2 = (!(__pyx_v_result != 0));
17306 0 : if (__pyx_t_2) {
17307 :
17308 : /* "View.MemoryView":1221
17309 : * result = malloc(size)
17310 : * if not result:
17311 : * _err_no_memory() # <<<<<<<<<<<<<<
17312 : *
17313 : *
17314 : */
17315 0 : __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
17316 :
17317 : /* "View.MemoryView":1220
17318 : *
17319 : * result = malloc(size)
17320 : * if not result: # <<<<<<<<<<<<<<
17321 : * _err_no_memory()
17322 : *
17323 : */
17324 : }
17325 :
17326 : /* "View.MemoryView":1224
17327 : *
17328 : *
17329 : * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
17330 : * tmpslice.memview = src.memview
17331 : * for i in range(ndim):
17332 : */
17333 0 : __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
17334 :
17335 : /* "View.MemoryView":1225
17336 : *
17337 : * tmpslice.data = <char *> result
17338 : * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
17339 : * for i in range(ndim):
17340 : * tmpslice.shape[i] = src.shape[i]
17341 : */
17342 0 : __pyx_t_4 = __pyx_v_src->memview;
17343 0 : __pyx_v_tmpslice->memview = __pyx_t_4;
17344 :
17345 : /* "View.MemoryView":1226
17346 : * tmpslice.data = <char *> result
17347 : * tmpslice.memview = src.memview
17348 : * for i in range(ndim): # <<<<<<<<<<<<<<
17349 : * tmpslice.shape[i] = src.shape[i]
17350 : * tmpslice.suboffsets[i] = -1
17351 : */
17352 0 : __pyx_t_3 = __pyx_v_ndim;
17353 0 : __pyx_t_5 = __pyx_t_3;
17354 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17355 0 : __pyx_v_i = __pyx_t_6;
17356 :
17357 : /* "View.MemoryView":1227
17358 : * tmpslice.memview = src.memview
17359 : * for i in range(ndim):
17360 : * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
17361 : * tmpslice.suboffsets[i] = -1
17362 : *
17363 : */
17364 0 : (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
17365 :
17366 : /* "View.MemoryView":1228
17367 : * for i in range(ndim):
17368 : * tmpslice.shape[i] = src.shape[i]
17369 : * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17370 : *
17371 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
17372 : */
17373 0 : (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
17374 : }
17375 :
17376 : /* "View.MemoryView":1230
17377 : * tmpslice.suboffsets[i] = -1
17378 : *
17379 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<<
17380 : *
17381 : *
17382 : */
17383 0 : (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
17384 :
17385 : /* "View.MemoryView":1233
17386 : *
17387 : *
17388 : * for i in range(ndim): # <<<<<<<<<<<<<<
17389 : * if tmpslice.shape[i] == 1:
17390 : * tmpslice.strides[i] = 0
17391 : */
17392 0 : __pyx_t_3 = __pyx_v_ndim;
17393 0 : __pyx_t_5 = __pyx_t_3;
17394 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
17395 0 : __pyx_v_i = __pyx_t_6;
17396 :
17397 : /* "View.MemoryView":1234
17398 : *
17399 : * for i in range(ndim):
17400 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17401 : * tmpslice.strides[i] = 0
17402 : *
17403 : */
17404 0 : __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
17405 0 : if (__pyx_t_2) {
17406 :
17407 : /* "View.MemoryView":1235
17408 : * for i in range(ndim):
17409 : * if tmpslice.shape[i] == 1:
17410 : * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
17411 : *
17412 : * if slice_is_contig(src[0], order, ndim):
17413 : */
17414 0 : (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
17415 :
17416 : /* "View.MemoryView":1234
17417 : *
17418 : * for i in range(ndim):
17419 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
17420 : * tmpslice.strides[i] = 0
17421 : *
17422 : */
17423 : }
17424 : }
17425 :
17426 : /* "View.MemoryView":1237
17427 : * tmpslice.strides[i] = 0
17428 : *
17429 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17430 : * memcpy(result, src.data, size)
17431 : * else:
17432 : */
17433 0 : __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
17434 0 : if (__pyx_t_2) {
17435 :
17436 : /* "View.MemoryView":1238
17437 : *
17438 : * if slice_is_contig(src[0], order, ndim):
17439 : * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
17440 : * else:
17441 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17442 : */
17443 0 : (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
17444 :
17445 : /* "View.MemoryView":1237
17446 : * tmpslice.strides[i] = 0
17447 : *
17448 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
17449 : * memcpy(result, src.data, size)
17450 : * else:
17451 : */
17452 0 : goto __pyx_L9;
17453 : }
17454 :
17455 : /* "View.MemoryView":1240
17456 : * memcpy(result, src.data, size)
17457 : * else:
17458 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
17459 : *
17460 : * return result
17461 : */
17462 0 : /*else*/ {
17463 0 : copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
17464 : }
17465 0 : __pyx_L9:;
17466 :
17467 : /* "View.MemoryView":1242
17468 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
17469 : *
17470 : * return result # <<<<<<<<<<<<<<
17471 : *
17472 : *
17473 : */
17474 0 : __pyx_r = __pyx_v_result;
17475 0 : goto __pyx_L0;
17476 :
17477 : /* "View.MemoryView":1205
17478 : *
17479 : * @cname('__pyx_memoryview_copy_data_to_temp')
17480 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
17481 : * __Pyx_memviewslice *tmpslice,
17482 : * char order,
17483 : */
17484 :
17485 : /* function exit code */
17486 0 : __pyx_L1_error:;
17487 : #ifdef WITH_THREAD
17488 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17489 : #endif
17490 0 : __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
17491 0 : __pyx_r = NULL;
17492 : #ifdef WITH_THREAD
17493 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17494 : #endif
17495 0 : __pyx_L0:;
17496 0 : return __pyx_r;
17497 : }
17498 :
17499 : /* "View.MemoryView":1247
17500 : *
17501 : * @cname('__pyx_memoryview_err_extents')
17502 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
17503 : * Py_ssize_t extent2) except -1 with gil:
17504 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
17505 : */
17506 :
17507 0 : static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
17508 0 : int __pyx_r;
17509 : __Pyx_RefNannyDeclarations
17510 0 : PyObject *__pyx_t_1 = NULL;
17511 0 : Py_ssize_t __pyx_t_2;
17512 0 : Py_UCS4 __pyx_t_3;
17513 0 : PyObject *__pyx_t_4 = NULL;
17514 0 : int __pyx_lineno = 0;
17515 0 : const char *__pyx_filename = NULL;
17516 0 : int __pyx_clineno = 0;
17517 : #ifdef WITH_THREAD
17518 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17519 : #endif
17520 0 : __Pyx_RefNannySetupContext("_err_extents", 0);
17521 :
17522 : /* "View.MemoryView":1249
17523 : * cdef int _err_extents(int i, Py_ssize_t extent1,
17524 : * Py_ssize_t extent2) except -1 with gil:
17525 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<<
17526 : *
17527 : * @cname('__pyx_memoryview_err_dim')
17528 : */
17529 0 : __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
17530 0 : __Pyx_GOTREF(__pyx_t_1);
17531 0 : __pyx_t_2 = 0;
17532 0 : __pyx_t_3 = 127;
17533 0 : __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi);
17534 0 : __pyx_t_2 += 35;
17535 0 : __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi);
17536 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi);
17537 0 : __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
17538 0 : __Pyx_GOTREF(__pyx_t_4);
17539 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
17540 0 : __Pyx_GIVEREF(__pyx_t_4);
17541 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
17542 0 : __pyx_t_4 = 0;
17543 0 : __Pyx_INCREF(__pyx_kp_u_got);
17544 0 : __pyx_t_2 += 6;
17545 0 : __Pyx_GIVEREF(__pyx_kp_u_got);
17546 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got);
17547 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
17548 0 : __Pyx_GOTREF(__pyx_t_4);
17549 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
17550 0 : __Pyx_GIVEREF(__pyx_t_4);
17551 0 : PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
17552 0 : __pyx_t_4 = 0;
17553 0 : __Pyx_INCREF(__pyx_kp_u_and);
17554 0 : __pyx_t_2 += 5;
17555 0 : __Pyx_GIVEREF(__pyx_kp_u_and);
17556 0 : PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and);
17557 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
17558 0 : __Pyx_GOTREF(__pyx_t_4);
17559 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
17560 0 : __Pyx_GIVEREF(__pyx_t_4);
17561 0 : PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
17562 0 : __pyx_t_4 = 0;
17563 0 : __Pyx_INCREF(__pyx_kp_u__7);
17564 0 : __pyx_t_2 += 1;
17565 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
17566 0 : PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7);
17567 0 : __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
17568 0 : __Pyx_GOTREF(__pyx_t_4);
17569 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17570 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
17571 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17572 0 : __PYX_ERR(1, 1249, __pyx_L1_error)
17573 :
17574 : /* "View.MemoryView":1247
17575 : *
17576 : * @cname('__pyx_memoryview_err_extents')
17577 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
17578 : * Py_ssize_t extent2) except -1 with gil:
17579 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
17580 : */
17581 :
17582 : /* function exit code */
17583 0 : __pyx_L1_error:;
17584 0 : __Pyx_XDECREF(__pyx_t_1);
17585 0 : __Pyx_XDECREF(__pyx_t_4);
17586 0 : __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17587 0 : __pyx_r = -1;
17588 0 : __Pyx_RefNannyFinishContext();
17589 : #ifdef WITH_THREAD
17590 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17591 : #endif
17592 0 : return __pyx_r;
17593 : }
17594 :
17595 : /* "View.MemoryView":1252
17596 : *
17597 : * @cname('__pyx_memoryview_err_dim')
17598 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
17599 : * raise <object>error, msg % dim
17600 : *
17601 : */
17602 :
17603 0 : static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
17604 0 : int __pyx_r;
17605 : __Pyx_RefNannyDeclarations
17606 0 : PyObject *__pyx_t_1 = NULL;
17607 0 : PyObject *__pyx_t_2 = NULL;
17608 0 : int __pyx_lineno = 0;
17609 0 : const char *__pyx_filename = NULL;
17610 0 : int __pyx_clineno = 0;
17611 : #ifdef WITH_THREAD
17612 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17613 : #endif
17614 0 : __Pyx_RefNannySetupContext("_err_dim", 0);
17615 0 : __Pyx_INCREF(__pyx_v_msg);
17616 :
17617 : /* "View.MemoryView":1253
17618 : * @cname('__pyx_memoryview_err_dim')
17619 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
17620 : * raise <object>error, msg % dim # <<<<<<<<<<<<<<
17621 : *
17622 : * @cname('__pyx_memoryview_err')
17623 : */
17624 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
17625 0 : __Pyx_GOTREF(__pyx_t_1);
17626 0 : __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
17627 0 : __Pyx_GOTREF(__pyx_t_2);
17628 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17629 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
17630 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17631 0 : __PYX_ERR(1, 1253, __pyx_L1_error)
17632 :
17633 : /* "View.MemoryView":1252
17634 : *
17635 : * @cname('__pyx_memoryview_err_dim')
17636 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
17637 : * raise <object>error, msg % dim
17638 : *
17639 : */
17640 :
17641 : /* function exit code */
17642 0 : __pyx_L1_error:;
17643 0 : __Pyx_XDECREF(__pyx_t_1);
17644 0 : __Pyx_XDECREF(__pyx_t_2);
17645 0 : __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
17646 0 : __pyx_r = -1;
17647 0 : __Pyx_XDECREF(__pyx_v_msg);
17648 0 : __Pyx_RefNannyFinishContext();
17649 : #ifdef WITH_THREAD
17650 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17651 : #endif
17652 0 : return __pyx_r;
17653 : }
17654 :
17655 : /* "View.MemoryView":1256
17656 : *
17657 : * @cname('__pyx_memoryview_err')
17658 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
17659 : * raise <object>error, msg
17660 : *
17661 : */
17662 :
17663 0 : static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
17664 0 : int __pyx_r;
17665 : __Pyx_RefNannyDeclarations
17666 0 : int __pyx_lineno = 0;
17667 0 : const char *__pyx_filename = NULL;
17668 0 : int __pyx_clineno = 0;
17669 : #ifdef WITH_THREAD
17670 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17671 : #endif
17672 0 : __Pyx_RefNannySetupContext("_err", 0);
17673 0 : __Pyx_INCREF(__pyx_v_msg);
17674 :
17675 : /* "View.MemoryView":1257
17676 : * @cname('__pyx_memoryview_err')
17677 : * cdef int _err(PyObject *error, str msg) except -1 with gil:
17678 : * raise <object>error, msg # <<<<<<<<<<<<<<
17679 : *
17680 : * @cname('__pyx_memoryview_err_no_memory')
17681 : */
17682 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
17683 0 : __PYX_ERR(1, 1257, __pyx_L1_error)
17684 :
17685 : /* "View.MemoryView":1256
17686 : *
17687 : * @cname('__pyx_memoryview_err')
17688 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
17689 : * raise <object>error, msg
17690 : *
17691 : */
17692 :
17693 : /* function exit code */
17694 0 : __pyx_L1_error:;
17695 0 : __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
17696 0 : __pyx_r = -1;
17697 0 : __Pyx_XDECREF(__pyx_v_msg);
17698 0 : __Pyx_RefNannyFinishContext();
17699 : #ifdef WITH_THREAD
17700 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17701 : #endif
17702 0 : return __pyx_r;
17703 : }
17704 :
17705 : /* "View.MemoryView":1260
17706 : *
17707 : * @cname('__pyx_memoryview_err_no_memory')
17708 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
17709 : * raise MemoryError
17710 : *
17711 : */
17712 :
17713 0 : static int __pyx_memoryview_err_no_memory(void) {
17714 0 : int __pyx_r;
17715 0 : int __pyx_lineno = 0;
17716 0 : const char *__pyx_filename = NULL;
17717 0 : int __pyx_clineno = 0;
17718 : #ifdef WITH_THREAD
17719 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17720 : #endif
17721 :
17722 : /* "View.MemoryView":1261
17723 : * @cname('__pyx_memoryview_err_no_memory')
17724 : * cdef int _err_no_memory() except -1 with gil:
17725 : * raise MemoryError # <<<<<<<<<<<<<<
17726 : *
17727 : *
17728 : */
17729 0 : PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)
17730 :
17731 : /* "View.MemoryView":1260
17732 : *
17733 : * @cname('__pyx_memoryview_err_no_memory')
17734 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
17735 : * raise MemoryError
17736 : *
17737 : */
17738 :
17739 : /* function exit code */
17740 0 : __pyx_L1_error:;
17741 0 : __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
17742 0 : __pyx_r = -1;
17743 : #ifdef WITH_THREAD
17744 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17745 : #endif
17746 0 : return __pyx_r;
17747 : }
17748 :
17749 : /* "View.MemoryView":1265
17750 : *
17751 : * @cname('__pyx_memoryview_copy_contents')
17752 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17753 : * __Pyx_memviewslice dst,
17754 : * int src_ndim, int dst_ndim,
17755 : */
17756 :
17757 3285054 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
17758 3285054 : void *__pyx_v_tmpdata;
17759 3285054 : size_t __pyx_v_itemsize;
17760 3285054 : int __pyx_v_i;
17761 3285054 : char __pyx_v_order;
17762 3285054 : int __pyx_v_broadcasting;
17763 3285054 : int __pyx_v_direct_copy;
17764 3285054 : __Pyx_memviewslice __pyx_v_tmp;
17765 3285054 : int __pyx_v_ndim;
17766 3285054 : int __pyx_r;
17767 3285054 : Py_ssize_t __pyx_t_1;
17768 3285054 : int __pyx_t_2;
17769 3285054 : int __pyx_t_3;
17770 3285054 : int __pyx_t_4;
17771 3285054 : int __pyx_t_5;
17772 3285054 : int __pyx_t_6;
17773 3285054 : void *__pyx_t_7;
17774 3285054 : int __pyx_lineno = 0;
17775 3285054 : const char *__pyx_filename = NULL;
17776 3285054 : int __pyx_clineno = 0;
17777 : #ifdef WITH_THREAD
17778 3285054 : PyGILState_STATE __pyx_gilstate_save;
17779 : #endif
17780 :
17781 : /* "View.MemoryView":1273
17782 : * Check for overlapping memory and verify the shapes.
17783 : * """
17784 : * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
17785 : * cdef size_t itemsize = src.memview.view.itemsize
17786 : * cdef int i
17787 : */
17788 3285054 : __pyx_v_tmpdata = NULL;
17789 :
17790 : /* "View.MemoryView":1274
17791 : * """
17792 : * cdef void *tmpdata = NULL
17793 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
17794 : * cdef int i
17795 : * cdef char order = get_best_order(&src, src_ndim)
17796 : */
17797 3285054 : __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
17798 3285054 : __pyx_v_itemsize = __pyx_t_1;
17799 :
17800 : /* "View.MemoryView":1276
17801 : * cdef size_t itemsize = src.memview.view.itemsize
17802 : * cdef int i
17803 : * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
17804 : * cdef bint broadcasting = False
17805 : * cdef bint direct_copy = False
17806 : */
17807 3285054 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
17808 :
17809 : /* "View.MemoryView":1277
17810 : * cdef int i
17811 : * cdef char order = get_best_order(&src, src_ndim)
17812 : * cdef bint broadcasting = False # <<<<<<<<<<<<<<
17813 : * cdef bint direct_copy = False
17814 : * cdef __Pyx_memviewslice tmp
17815 : */
17816 3285054 : __pyx_v_broadcasting = 0;
17817 :
17818 : /* "View.MemoryView":1278
17819 : * cdef char order = get_best_order(&src, src_ndim)
17820 : * cdef bint broadcasting = False
17821 : * cdef bint direct_copy = False # <<<<<<<<<<<<<<
17822 : * cdef __Pyx_memviewslice tmp
17823 : *
17824 : */
17825 3285054 : __pyx_v_direct_copy = 0;
17826 :
17827 : /* "View.MemoryView":1281
17828 : * cdef __Pyx_memviewslice tmp
17829 : *
17830 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17831 : * broadcast_leading(&src, src_ndim, dst_ndim)
17832 : * elif dst_ndim < src_ndim:
17833 : */
17834 3285054 : __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
17835 3285054 : if (__pyx_t_2) {
17836 :
17837 : /* "View.MemoryView":1282
17838 : *
17839 : * if src_ndim < dst_ndim:
17840 : * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17841 : * elif dst_ndim < src_ndim:
17842 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17843 : */
17844 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
17845 :
17846 : /* "View.MemoryView":1281
17847 : * cdef __Pyx_memviewslice tmp
17848 : *
17849 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
17850 : * broadcast_leading(&src, src_ndim, dst_ndim)
17851 : * elif dst_ndim < src_ndim:
17852 : */
17853 0 : goto __pyx_L3;
17854 : }
17855 :
17856 : /* "View.MemoryView":1283
17857 : * if src_ndim < dst_ndim:
17858 : * broadcast_leading(&src, src_ndim, dst_ndim)
17859 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17860 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17861 : *
17862 : */
17863 3285054 : __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
17864 3285054 : if (__pyx_t_2) {
17865 :
17866 : /* "View.MemoryView":1284
17867 : * broadcast_leading(&src, src_ndim, dst_ndim)
17868 : * elif dst_ndim < src_ndim:
17869 : * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
17870 : *
17871 : * cdef int ndim = max(src_ndim, dst_ndim)
17872 : */
17873 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
17874 :
17875 : /* "View.MemoryView":1283
17876 : * if src_ndim < dst_ndim:
17877 : * broadcast_leading(&src, src_ndim, dst_ndim)
17878 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
17879 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17880 : *
17881 : */
17882 : }
17883 3285054 : __pyx_L3:;
17884 :
17885 : /* "View.MemoryView":1286
17886 : * broadcast_leading(&dst, dst_ndim, src_ndim)
17887 : *
17888 : * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
17889 : *
17890 : * for i in range(ndim):
17891 : */
17892 3285054 : __pyx_t_3 = __pyx_v_dst_ndim;
17893 3285054 : __pyx_t_4 = __pyx_v_src_ndim;
17894 3285054 : __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
17895 3285054 : if (__pyx_t_2) {
17896 : __pyx_t_5 = __pyx_t_3;
17897 : } else {
17898 : __pyx_t_5 = __pyx_t_4;
17899 : }
17900 3285054 : __pyx_v_ndim = __pyx_t_5;
17901 :
17902 : /* "View.MemoryView":1288
17903 : * cdef int ndim = max(src_ndim, dst_ndim)
17904 : *
17905 : * for i in range(ndim): # <<<<<<<<<<<<<<
17906 : * if src.shape[i] != dst.shape[i]:
17907 : * if src.shape[i] == 1:
17908 : */
17909 3285054 : __pyx_t_5 = __pyx_v_ndim;
17910 3285054 : __pyx_t_3 = __pyx_t_5;
17911 6570108 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17912 3285054 : __pyx_v_i = __pyx_t_4;
17913 :
17914 : /* "View.MemoryView":1289
17915 : *
17916 : * for i in range(ndim):
17917 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17918 : * if src.shape[i] == 1:
17919 : * broadcasting = True
17920 : */
17921 3285054 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
17922 3285054 : if (__pyx_t_2) {
17923 :
17924 : /* "View.MemoryView":1290
17925 : * for i in range(ndim):
17926 : * if src.shape[i] != dst.shape[i]:
17927 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17928 : * broadcasting = True
17929 : * src.strides[i] = 0
17930 : */
17931 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17932 0 : if (__pyx_t_2) {
17933 :
17934 : /* "View.MemoryView":1291
17935 : * if src.shape[i] != dst.shape[i]:
17936 : * if src.shape[i] == 1:
17937 : * broadcasting = True # <<<<<<<<<<<<<<
17938 : * src.strides[i] = 0
17939 : * else:
17940 : */
17941 0 : __pyx_v_broadcasting = 1;
17942 :
17943 : /* "View.MemoryView":1292
17944 : * if src.shape[i] == 1:
17945 : * broadcasting = True
17946 : * src.strides[i] = 0 # <<<<<<<<<<<<<<
17947 : * else:
17948 : * _err_extents(i, dst.shape[i], src.shape[i])
17949 : */
17950 0 : (__pyx_v_src.strides[__pyx_v_i]) = 0;
17951 :
17952 : /* "View.MemoryView":1290
17953 : * for i in range(ndim):
17954 : * if src.shape[i] != dst.shape[i]:
17955 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17956 : * broadcasting = True
17957 : * src.strides[i] = 0
17958 : */
17959 0 : goto __pyx_L7;
17960 : }
17961 :
17962 : /* "View.MemoryView":1294
17963 : * src.strides[i] = 0
17964 : * else:
17965 : * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17966 : *
17967 : * if src.suboffsets[i] >= 0:
17968 : */
17969 0 : /*else*/ {
17970 0 : __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
17971 : }
17972 0 : __pyx_L7:;
17973 :
17974 : /* "View.MemoryView":1289
17975 : *
17976 : * for i in range(ndim):
17977 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17978 : * if src.shape[i] == 1:
17979 : * broadcasting = True
17980 : */
17981 : }
17982 :
17983 : /* "View.MemoryView":1296
17984 : * _err_extents(i, dst.shape[i], src.shape[i])
17985 : *
17986 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17987 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17988 : *
17989 : */
17990 3285054 : __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17991 3285054 : if (__pyx_t_2) {
17992 :
17993 : /* "View.MemoryView":1297
17994 : *
17995 : * if src.suboffsets[i] >= 0:
17996 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17997 : *
17998 : * if slices_overlap(&src, &dst, ndim, itemsize):
17999 : */
18000 0 : __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
18001 :
18002 : /* "View.MemoryView":1296
18003 : * _err_extents(i, dst.shape[i], src.shape[i])
18004 : *
18005 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
18006 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
18007 : *
18008 : */
18009 : }
18010 : }
18011 :
18012 : /* "View.MemoryView":1299
18013 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
18014 : *
18015 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18016 : *
18017 : * if not slice_is_contig(src, order, ndim):
18018 : */
18019 3285054 : __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18020 3285054 : if (__pyx_t_2) {
18021 :
18022 : /* "View.MemoryView":1301
18023 : * if slices_overlap(&src, &dst, ndim, itemsize):
18024 : *
18025 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18026 : * order = get_best_order(&dst, ndim)
18027 : *
18028 : */
18029 0 : __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
18030 0 : if (__pyx_t_2) {
18031 :
18032 : /* "View.MemoryView":1302
18033 : *
18034 : * if not slice_is_contig(src, order, ndim):
18035 : * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
18036 : *
18037 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18038 : */
18039 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
18040 :
18041 : /* "View.MemoryView":1301
18042 : * if slices_overlap(&src, &dst, ndim, itemsize):
18043 : *
18044 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
18045 : * order = get_best_order(&dst, ndim)
18046 : *
18047 : */
18048 : }
18049 :
18050 : /* "View.MemoryView":1304
18051 : * order = get_best_order(&dst, ndim)
18052 : *
18053 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
18054 : * src = tmp
18055 : *
18056 : */
18057 0 : __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
18058 0 : __pyx_v_tmpdata = __pyx_t_7;
18059 :
18060 : /* "View.MemoryView":1305
18061 : *
18062 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
18063 : * src = tmp # <<<<<<<<<<<<<<
18064 : *
18065 : * if not broadcasting:
18066 : */
18067 0 : __pyx_v_src = __pyx_v_tmp;
18068 :
18069 : /* "View.MemoryView":1299
18070 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
18071 : *
18072 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
18073 : *
18074 : * if not slice_is_contig(src, order, ndim):
18075 : */
18076 : }
18077 :
18078 : /* "View.MemoryView":1307
18079 : * src = tmp
18080 : *
18081 : * if not broadcasting: # <<<<<<<<<<<<<<
18082 : *
18083 : *
18084 : */
18085 3285054 : __pyx_t_2 = (!__pyx_v_broadcasting);
18086 3285054 : if (__pyx_t_2) {
18087 :
18088 : /* "View.MemoryView":1310
18089 : *
18090 : *
18091 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18092 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18093 : * elif slice_is_contig(src, 'F', ndim):
18094 : */
18095 3285054 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
18096 3285054 : if (__pyx_t_2) {
18097 :
18098 : /* "View.MemoryView":1311
18099 : *
18100 : * if slice_is_contig(src, 'C', ndim):
18101 : * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
18102 : * elif slice_is_contig(src, 'F', ndim):
18103 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18104 : */
18105 3285054 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
18106 :
18107 : /* "View.MemoryView":1310
18108 : *
18109 : *
18110 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
18111 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18112 : * elif slice_is_contig(src, 'F', ndim):
18113 : */
18114 3285054 : goto __pyx_L12;
18115 : }
18116 :
18117 : /* "View.MemoryView":1312
18118 : * if slice_is_contig(src, 'C', ndim):
18119 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18120 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18121 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18122 : *
18123 : */
18124 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
18125 0 : if (__pyx_t_2) {
18126 :
18127 : /* "View.MemoryView":1313
18128 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18129 : * elif slice_is_contig(src, 'F', ndim):
18130 : * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
18131 : *
18132 : * if direct_copy:
18133 : */
18134 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
18135 :
18136 : /* "View.MemoryView":1312
18137 : * if slice_is_contig(src, 'C', ndim):
18138 : * direct_copy = slice_is_contig(dst, 'C', ndim)
18139 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
18140 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18141 : *
18142 : */
18143 : }
18144 3285054 : __pyx_L12:;
18145 :
18146 : /* "View.MemoryView":1315
18147 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18148 : *
18149 : * if direct_copy: # <<<<<<<<<<<<<<
18150 : *
18151 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18152 : */
18153 3285054 : if (__pyx_v_direct_copy) {
18154 :
18155 : /* "View.MemoryView":1317
18156 : * if direct_copy:
18157 : *
18158 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18159 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18160 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18161 : */
18162 3285054 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18163 :
18164 : /* "View.MemoryView":1318
18165 : *
18166 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18167 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
18168 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18169 : * free(tmpdata)
18170 : */
18171 6570108 : (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
18172 :
18173 : /* "View.MemoryView":1319
18174 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18175 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18176 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18177 : * free(tmpdata)
18178 : * return 0
18179 : */
18180 3285054 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18181 :
18182 : /* "View.MemoryView":1320
18183 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
18184 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18185 : * free(tmpdata) # <<<<<<<<<<<<<<
18186 : * return 0
18187 : *
18188 : */
18189 3285054 : free(__pyx_v_tmpdata);
18190 :
18191 : /* "View.MemoryView":1321
18192 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18193 : * free(tmpdata)
18194 : * return 0 # <<<<<<<<<<<<<<
18195 : *
18196 : * if order == 'F' == get_best_order(&dst, ndim):
18197 : */
18198 3285054 : __pyx_r = 0;
18199 3285054 : goto __pyx_L0;
18200 :
18201 : /* "View.MemoryView":1315
18202 : * direct_copy = slice_is_contig(dst, 'F', ndim)
18203 : *
18204 : * if direct_copy: # <<<<<<<<<<<<<<
18205 : *
18206 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18207 : */
18208 : }
18209 :
18210 : /* "View.MemoryView":1307
18211 : * src = tmp
18212 : *
18213 : * if not broadcasting: # <<<<<<<<<<<<<<
18214 : *
18215 : *
18216 : */
18217 : }
18218 :
18219 : /* "View.MemoryView":1323
18220 : * return 0
18221 : *
18222 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18223 : *
18224 : *
18225 : */
18226 0 : __pyx_t_2 = (__pyx_v_order == 'F');
18227 0 : if (__pyx_t_2) {
18228 0 : __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
18229 : }
18230 0 : if (__pyx_t_2) {
18231 :
18232 : /* "View.MemoryView":1326
18233 : *
18234 : *
18235 : * transpose_memslice(&src) # <<<<<<<<<<<<<<
18236 : * transpose_memslice(&dst)
18237 : *
18238 : */
18239 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)
18240 :
18241 : /* "View.MemoryView":1327
18242 : *
18243 : * transpose_memslice(&src)
18244 : * transpose_memslice(&dst) # <<<<<<<<<<<<<<
18245 : *
18246 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18247 : */
18248 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)
18249 :
18250 : /* "View.MemoryView":1323
18251 : * return 0
18252 : *
18253 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
18254 : *
18255 : *
18256 : */
18257 : }
18258 :
18259 : /* "View.MemoryView":1329
18260 : * transpose_memslice(&dst)
18261 : *
18262 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18263 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18264 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18265 : */
18266 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18267 :
18268 : /* "View.MemoryView":1330
18269 : *
18270 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18271 : * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
18272 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18273 : *
18274 : */
18275 0 : copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
18276 :
18277 : /* "View.MemoryView":1331
18278 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
18279 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
18280 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18281 : *
18282 : * free(tmpdata)
18283 : */
18284 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18285 :
18286 : /* "View.MemoryView":1333
18287 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
18288 : *
18289 : * free(tmpdata) # <<<<<<<<<<<<<<
18290 : * return 0
18291 : *
18292 : */
18293 0 : free(__pyx_v_tmpdata);
18294 :
18295 : /* "View.MemoryView":1334
18296 : *
18297 : * free(tmpdata)
18298 : * return 0 # <<<<<<<<<<<<<<
18299 : *
18300 : * @cname('__pyx_memoryview_broadcast_leading')
18301 : */
18302 0 : __pyx_r = 0;
18303 0 : goto __pyx_L0;
18304 :
18305 : /* "View.MemoryView":1265
18306 : *
18307 : * @cname('__pyx_memoryview_copy_contents')
18308 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
18309 : * __Pyx_memviewslice dst,
18310 : * int src_ndim, int dst_ndim,
18311 : */
18312 :
18313 : /* function exit code */
18314 0 : __pyx_L1_error:;
18315 : #ifdef WITH_THREAD
18316 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18317 : #endif
18318 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18319 0 : __pyx_r = -1;
18320 : #ifdef WITH_THREAD
18321 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18322 : #endif
18323 3285054 : __pyx_L0:;
18324 3285054 : return __pyx_r;
18325 : }
18326 :
18327 : /* "View.MemoryView":1337
18328 : *
18329 : * @cname('__pyx_memoryview_broadcast_leading')
18330 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
18331 : * int ndim,
18332 : * int ndim_other) noexcept nogil:
18333 : */
18334 :
18335 0 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
18336 0 : int __pyx_v_i;
18337 0 : int __pyx_v_offset;
18338 0 : int __pyx_t_1;
18339 0 : int __pyx_t_2;
18340 0 : int __pyx_t_3;
18341 :
18342 : /* "View.MemoryView":1341
18343 : * int ndim_other) noexcept nogil:
18344 : * cdef int i
18345 : * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
18346 : *
18347 : * for i in range(ndim - 1, -1, -1):
18348 : */
18349 0 : __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
18350 :
18351 : /* "View.MemoryView":1343
18352 : * cdef int offset = ndim_other - ndim
18353 : *
18354 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18355 : * mslice.shape[i + offset] = mslice.shape[i]
18356 : * mslice.strides[i + offset] = mslice.strides[i]
18357 : */
18358 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18359 0 : __pyx_v_i = __pyx_t_1;
18360 :
18361 : /* "View.MemoryView":1344
18362 : *
18363 : * for i in range(ndim - 1, -1, -1):
18364 : * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
18365 : * mslice.strides[i + offset] = mslice.strides[i]
18366 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18367 : */
18368 0 : (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
18369 :
18370 : /* "View.MemoryView":1345
18371 : * for i in range(ndim - 1, -1, -1):
18372 : * mslice.shape[i + offset] = mslice.shape[i]
18373 : * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
18374 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18375 : *
18376 : */
18377 0 : (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
18378 :
18379 : /* "View.MemoryView":1346
18380 : * mslice.shape[i + offset] = mslice.shape[i]
18381 : * mslice.strides[i + offset] = mslice.strides[i]
18382 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
18383 : *
18384 : * for i in range(offset):
18385 : */
18386 0 : (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
18387 : }
18388 :
18389 : /* "View.MemoryView":1348
18390 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
18391 : *
18392 : * for i in range(offset): # <<<<<<<<<<<<<<
18393 : * mslice.shape[i] = 1
18394 : * mslice.strides[i] = mslice.strides[0]
18395 : */
18396 0 : __pyx_t_1 = __pyx_v_offset;
18397 : __pyx_t_2 = __pyx_t_1;
18398 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18399 0 : __pyx_v_i = __pyx_t_3;
18400 :
18401 : /* "View.MemoryView":1349
18402 : *
18403 : * for i in range(offset):
18404 : * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
18405 : * mslice.strides[i] = mslice.strides[0]
18406 : * mslice.suboffsets[i] = -1
18407 : */
18408 0 : (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
18409 :
18410 : /* "View.MemoryView":1350
18411 : * for i in range(offset):
18412 : * mslice.shape[i] = 1
18413 : * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
18414 : * mslice.suboffsets[i] = -1
18415 : *
18416 : */
18417 0 : (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
18418 :
18419 : /* "View.MemoryView":1351
18420 : * mslice.shape[i] = 1
18421 : * mslice.strides[i] = mslice.strides[0]
18422 : * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18423 : *
18424 : *
18425 : */
18426 0 : (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
18427 : }
18428 :
18429 : /* "View.MemoryView":1337
18430 : *
18431 : * @cname('__pyx_memoryview_broadcast_leading')
18432 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
18433 : * int ndim,
18434 : * int ndim_other) noexcept nogil:
18435 : */
18436 :
18437 : /* function exit code */
18438 0 : }
18439 :
18440 : /* "View.MemoryView":1359
18441 : *
18442 : * @cname('__pyx_memoryview_refcount_copying')
18443 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
18444 : *
18445 : * if dtype_is_object:
18446 : */
18447 :
18448 6570108 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
18449 :
18450 : /* "View.MemoryView":1361
18451 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18452 : *
18453 : * if dtype_is_object: # <<<<<<<<<<<<<<
18454 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18455 : *
18456 : */
18457 6570108 : if (__pyx_v_dtype_is_object) {
18458 :
18459 : /* "View.MemoryView":1362
18460 : *
18461 : * if dtype_is_object:
18462 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
18463 : *
18464 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18465 : */
18466 0 : __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
18467 :
18468 : /* "View.MemoryView":1361
18469 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
18470 : *
18471 : * if dtype_is_object: # <<<<<<<<<<<<<<
18472 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
18473 : *
18474 : */
18475 : }
18476 :
18477 : /* "View.MemoryView":1359
18478 : *
18479 : * @cname('__pyx_memoryview_refcount_copying')
18480 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
18481 : *
18482 : * if dtype_is_object:
18483 : */
18484 :
18485 : /* function exit code */
18486 6570108 : }
18487 :
18488 : /* "View.MemoryView":1365
18489 : *
18490 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18491 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18492 : * Py_ssize_t *strides, int ndim,
18493 : * bint inc) noexcept with gil:
18494 : */
18495 :
18496 0 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18497 : #ifdef WITH_THREAD
18498 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18499 : #endif
18500 :
18501 : /* "View.MemoryView":1368
18502 : * Py_ssize_t *strides, int ndim,
18503 : * bint inc) noexcept with gil:
18504 : * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
18505 : *
18506 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
18507 : */
18508 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
18509 :
18510 : /* "View.MemoryView":1365
18511 : *
18512 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
18513 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18514 : * Py_ssize_t *strides, int ndim,
18515 : * bint inc) noexcept with gil:
18516 : */
18517 :
18518 : /* function exit code */
18519 : #ifdef WITH_THREAD
18520 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
18521 : #endif
18522 0 : }
18523 :
18524 : /* "View.MemoryView":1371
18525 : *
18526 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
18527 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18528 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18529 : * cdef Py_ssize_t i
18530 : */
18531 :
18532 0 : static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
18533 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18534 0 : Py_ssize_t __pyx_v_stride;
18535 0 : Py_ssize_t __pyx_t_1;
18536 0 : Py_ssize_t __pyx_t_2;
18537 0 : Py_ssize_t __pyx_t_3;
18538 0 : int __pyx_t_4;
18539 :
18540 : /* "View.MemoryView":1374
18541 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18542 : * cdef Py_ssize_t i
18543 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18544 : *
18545 : * for i in range(shape[0]):
18546 : */
18547 0 : __pyx_v_stride = (__pyx_v_strides[0]);
18548 :
18549 : /* "View.MemoryView":1376
18550 : * cdef Py_ssize_t stride = strides[0]
18551 : *
18552 : * for i in range(shape[0]): # <<<<<<<<<<<<<<
18553 : * if ndim == 1:
18554 : * if inc:
18555 : */
18556 0 : __pyx_t_1 = (__pyx_v_shape[0]);
18557 0 : __pyx_t_2 = __pyx_t_1;
18558 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18559 0 : __pyx_v_i = __pyx_t_3;
18560 :
18561 : /* "View.MemoryView":1377
18562 : *
18563 : * for i in range(shape[0]):
18564 : * if ndim == 1: # <<<<<<<<<<<<<<
18565 : * if inc:
18566 : * Py_INCREF((<PyObject **> data)[0])
18567 : */
18568 0 : __pyx_t_4 = (__pyx_v_ndim == 1);
18569 0 : if (__pyx_t_4) {
18570 :
18571 : /* "View.MemoryView":1378
18572 : * for i in range(shape[0]):
18573 : * if ndim == 1:
18574 : * if inc: # <<<<<<<<<<<<<<
18575 : * Py_INCREF((<PyObject **> data)[0])
18576 : * else:
18577 : */
18578 0 : if (__pyx_v_inc) {
18579 :
18580 : /* "View.MemoryView":1379
18581 : * if ndim == 1:
18582 : * if inc:
18583 : * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18584 : * else:
18585 : * Py_DECREF((<PyObject **> data)[0])
18586 : */
18587 0 : Py_INCREF((((PyObject **)__pyx_v_data)[0]));
18588 :
18589 : /* "View.MemoryView":1378
18590 : * for i in range(shape[0]):
18591 : * if ndim == 1:
18592 : * if inc: # <<<<<<<<<<<<<<
18593 : * Py_INCREF((<PyObject **> data)[0])
18594 : * else:
18595 : */
18596 0 : goto __pyx_L6;
18597 : }
18598 :
18599 : /* "View.MemoryView":1381
18600 : * Py_INCREF((<PyObject **> data)[0])
18601 : * else:
18602 : * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
18603 : * else:
18604 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18605 : */
18606 0 : /*else*/ {
18607 0 : Py_DECREF((((PyObject **)__pyx_v_data)[0]));
18608 : }
18609 0 : __pyx_L6:;
18610 :
18611 : /* "View.MemoryView":1377
18612 : *
18613 : * for i in range(shape[0]):
18614 : * if ndim == 1: # <<<<<<<<<<<<<<
18615 : * if inc:
18616 : * Py_INCREF((<PyObject **> data)[0])
18617 : */
18618 0 : goto __pyx_L5;
18619 : }
18620 :
18621 : /* "View.MemoryView":1383
18622 : * Py_DECREF((<PyObject **> data)[0])
18623 : * else:
18624 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
18625 : *
18626 : * data += stride
18627 : */
18628 0 : /*else*/ {
18629 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
18630 : }
18631 0 : __pyx_L5:;
18632 :
18633 : /* "View.MemoryView":1385
18634 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
18635 : *
18636 : * data += stride # <<<<<<<<<<<<<<
18637 : *
18638 : *
18639 : */
18640 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18641 : }
18642 :
18643 : /* "View.MemoryView":1371
18644 : *
18645 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
18646 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18647 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
18648 : * cdef Py_ssize_t i
18649 : */
18650 :
18651 : /* function exit code */
18652 0 : }
18653 :
18654 : /* "View.MemoryView":1391
18655 : *
18656 : * @cname('__pyx_memoryview_slice_assign_scalar')
18657 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
18658 : * size_t itemsize, void *item,
18659 : * bint dtype_is_object) noexcept nogil:
18660 : */
18661 :
18662 0 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
18663 :
18664 : /* "View.MemoryView":1394
18665 : * size_t itemsize, void *item,
18666 : * bint dtype_is_object) noexcept nogil:
18667 : * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
18668 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18669 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18670 : */
18671 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
18672 :
18673 : /* "View.MemoryView":1395
18674 : * bint dtype_is_object) noexcept nogil:
18675 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18676 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
18677 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
18678 : *
18679 : */
18680 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
18681 :
18682 : /* "View.MemoryView":1396
18683 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
18684 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
18685 : * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
18686 : *
18687 : *
18688 : */
18689 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
18690 :
18691 : /* "View.MemoryView":1391
18692 : *
18693 : * @cname('__pyx_memoryview_slice_assign_scalar')
18694 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
18695 : * size_t itemsize, void *item,
18696 : * bint dtype_is_object) noexcept nogil:
18697 : */
18698 :
18699 : /* function exit code */
18700 0 : }
18701 :
18702 : /* "View.MemoryView":1400
18703 : *
18704 : * @cname('__pyx_memoryview__slice_assign_scalar')
18705 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18706 : * Py_ssize_t *strides, int ndim,
18707 : * size_t itemsize, void *item) noexcept nogil:
18708 : */
18709 :
18710 0 : static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
18711 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18712 0 : Py_ssize_t __pyx_v_stride;
18713 0 : Py_ssize_t __pyx_v_extent;
18714 0 : int __pyx_t_1;
18715 0 : Py_ssize_t __pyx_t_2;
18716 0 : Py_ssize_t __pyx_t_3;
18717 0 : Py_ssize_t __pyx_t_4;
18718 :
18719 : /* "View.MemoryView":1404
18720 : * size_t itemsize, void *item) noexcept nogil:
18721 : * cdef Py_ssize_t i
18722 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
18723 : * cdef Py_ssize_t extent = shape[0]
18724 : *
18725 : */
18726 0 : __pyx_v_stride = (__pyx_v_strides[0]);
18727 :
18728 : /* "View.MemoryView":1405
18729 : * cdef Py_ssize_t i
18730 : * cdef Py_ssize_t stride = strides[0]
18731 : * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
18732 : *
18733 : * if ndim == 1:
18734 : */
18735 0 : __pyx_v_extent = (__pyx_v_shape[0]);
18736 :
18737 : /* "View.MemoryView":1407
18738 : * cdef Py_ssize_t extent = shape[0]
18739 : *
18740 : * if ndim == 1: # <<<<<<<<<<<<<<
18741 : * for i in range(extent):
18742 : * memcpy(data, item, itemsize)
18743 : */
18744 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
18745 0 : if (__pyx_t_1) {
18746 :
18747 : /* "View.MemoryView":1408
18748 : *
18749 : * if ndim == 1:
18750 : * for i in range(extent): # <<<<<<<<<<<<<<
18751 : * memcpy(data, item, itemsize)
18752 : * data += stride
18753 : */
18754 : __pyx_t_2 = __pyx_v_extent;
18755 : __pyx_t_3 = __pyx_t_2;
18756 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18757 0 : __pyx_v_i = __pyx_t_4;
18758 :
18759 : /* "View.MemoryView":1409
18760 : * if ndim == 1:
18761 : * for i in range(extent):
18762 : * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
18763 : * data += stride
18764 : * else:
18765 : */
18766 0 : (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
18767 :
18768 : /* "View.MemoryView":1410
18769 : * for i in range(extent):
18770 : * memcpy(data, item, itemsize)
18771 : * data += stride # <<<<<<<<<<<<<<
18772 : * else:
18773 : * for i in range(extent):
18774 : */
18775 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18776 : }
18777 :
18778 : /* "View.MemoryView":1407
18779 : * cdef Py_ssize_t extent = shape[0]
18780 : *
18781 : * if ndim == 1: # <<<<<<<<<<<<<<
18782 : * for i in range(extent):
18783 : * memcpy(data, item, itemsize)
18784 : */
18785 0 : goto __pyx_L3;
18786 : }
18787 :
18788 : /* "View.MemoryView":1412
18789 : * data += stride
18790 : * else:
18791 : * for i in range(extent): # <<<<<<<<<<<<<<
18792 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18793 : * data += stride
18794 : */
18795 : /*else*/ {
18796 : __pyx_t_2 = __pyx_v_extent;
18797 : __pyx_t_3 = __pyx_t_2;
18798 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18799 0 : __pyx_v_i = __pyx_t_4;
18800 :
18801 : /* "View.MemoryView":1413
18802 : * else:
18803 : * for i in range(extent):
18804 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
18805 : * data += stride
18806 : *
18807 : */
18808 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
18809 :
18810 : /* "View.MemoryView":1414
18811 : * for i in range(extent):
18812 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
18813 : * data += stride # <<<<<<<<<<<<<<
18814 : *
18815 : *
18816 : */
18817 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
18818 : }
18819 : }
18820 0 : __pyx_L3:;
18821 :
18822 : /* "View.MemoryView":1400
18823 : *
18824 : * @cname('__pyx_memoryview__slice_assign_scalar')
18825 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
18826 : * Py_ssize_t *strides, int ndim,
18827 : * size_t itemsize, void *item) noexcept nogil:
18828 : */
18829 :
18830 : /* function exit code */
18831 0 : }
18832 :
18833 : /* "(tree fragment)":1
18834 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18835 : * cdef object __pyx_PickleError
18836 : * cdef object __pyx_result
18837 : */
18838 :
18839 : /* Python wrapper */
18840 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18841 : #if CYTHON_METH_FASTCALL
18842 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18843 : #else
18844 : PyObject *__pyx_args, PyObject *__pyx_kwds
18845 : #endif
18846 : ); /*proto*/
18847 : static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
18848 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
18849 : #if CYTHON_METH_FASTCALL
18850 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
18851 : #else
18852 : PyObject *__pyx_args, PyObject *__pyx_kwds
18853 : #endif
18854 : ) {
18855 0 : PyObject *__pyx_v___pyx_type = 0;
18856 0 : long __pyx_v___pyx_checksum;
18857 0 : PyObject *__pyx_v___pyx_state = 0;
18858 : #if !CYTHON_METH_FASTCALL
18859 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
18860 : #endif
18861 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
18862 0 : PyObject* values[3] = {0,0,0};
18863 0 : int __pyx_lineno = 0;
18864 0 : const char *__pyx_filename = NULL;
18865 0 : int __pyx_clineno = 0;
18866 0 : PyObject *__pyx_r = 0;
18867 : __Pyx_RefNannyDeclarations
18868 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
18869 : #if !CYTHON_METH_FASTCALL
18870 : #if CYTHON_ASSUME_SAFE_MACROS
18871 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
18872 : #else
18873 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
18874 : #endif
18875 : #endif
18876 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
18877 0 : {
18878 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
18879 0 : if (__pyx_kwds) {
18880 0 : Py_ssize_t kw_args;
18881 0 : switch (__pyx_nargs) {
18882 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18883 0 : CYTHON_FALLTHROUGH;
18884 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18885 0 : CYTHON_FALLTHROUGH;
18886 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18887 0 : CYTHON_FALLTHROUGH;
18888 0 : case 0: break;
18889 0 : default: goto __pyx_L5_argtuple_error;
18890 : }
18891 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
18892 0 : switch (__pyx_nargs) {
18893 0 : case 0:
18894 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
18895 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
18896 0 : kw_args--;
18897 : }
18898 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18899 0 : else goto __pyx_L5_argtuple_error;
18900 0 : CYTHON_FALLTHROUGH;
18901 0 : case 1:
18902 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
18903 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
18904 0 : kw_args--;
18905 : }
18906 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18907 : else {
18908 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
18909 : }
18910 0 : CYTHON_FALLTHROUGH;
18911 0 : case 2:
18912 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
18913 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
18914 0 : kw_args--;
18915 : }
18916 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18917 : else {
18918 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
18919 : }
18920 : }
18921 0 : if (unlikely(kw_args > 0)) {
18922 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
18923 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
18924 : }
18925 0 : } else if (unlikely(__pyx_nargs != 3)) {
18926 0 : goto __pyx_L5_argtuple_error;
18927 : } else {
18928 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18929 0 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18930 0 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18931 : }
18932 0 : __pyx_v___pyx_type = values[0];
18933 0 : __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18934 0 : __pyx_v___pyx_state = values[2];
18935 : }
18936 0 : goto __pyx_L6_skip;
18937 0 : __pyx_L5_argtuple_error:;
18938 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
18939 0 : __pyx_L6_skip:;
18940 0 : goto __pyx_L4_argument_unpacking_done;
18941 0 : __pyx_L3_error:;
18942 0 : {
18943 0 : Py_ssize_t __pyx_temp;
18944 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18945 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18946 : }
18947 : }
18948 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18949 : __Pyx_RefNannyFinishContext();
18950 : return NULL;
18951 0 : __pyx_L4_argument_unpacking_done:;
18952 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18953 :
18954 : /* function exit code */
18955 : {
18956 : Py_ssize_t __pyx_temp;
18957 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18958 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18959 : }
18960 : }
18961 : __Pyx_RefNannyFinishContext();
18962 : return __pyx_r;
18963 : }
18964 :
18965 0 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18966 0 : PyObject *__pyx_v___pyx_PickleError = 0;
18967 0 : PyObject *__pyx_v___pyx_result = 0;
18968 0 : PyObject *__pyx_r = NULL;
18969 : __Pyx_RefNannyDeclarations
18970 0 : PyObject *__pyx_t_1 = NULL;
18971 0 : int __pyx_t_2;
18972 0 : PyObject *__pyx_t_3 = NULL;
18973 0 : PyObject *__pyx_t_4 = NULL;
18974 0 : unsigned int __pyx_t_5;
18975 0 : int __pyx_lineno = 0;
18976 0 : const char *__pyx_filename = NULL;
18977 0 : int __pyx_clineno = 0;
18978 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1);
18979 :
18980 : /* "(tree fragment)":4
18981 : * cdef object __pyx_PickleError
18982 : * cdef object __pyx_result
18983 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18984 : * from pickle import PickleError as __pyx_PickleError
18985 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18986 : */
18987 0 : __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18988 0 : __Pyx_GOTREF(__pyx_t_1);
18989 0 : __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
18990 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18991 0 : if (__pyx_t_2) {
18992 :
18993 : /* "(tree fragment)":5
18994 : * cdef object __pyx_result
18995 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18996 : * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
18997 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18998 : * __pyx_result = Enum.__new__(__pyx_type)
18999 : */
19000 0 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
19001 0 : __Pyx_GOTREF(__pyx_t_1);
19002 0 : __Pyx_INCREF(__pyx_n_s_PickleError);
19003 0 : __Pyx_GIVEREF(__pyx_n_s_PickleError);
19004 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error);
19005 0 : __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
19006 0 : __Pyx_GOTREF(__pyx_t_3);
19007 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19008 0 : __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
19009 0 : __Pyx_GOTREF(__pyx_t_1);
19010 0 : __Pyx_INCREF(__pyx_t_1);
19011 0 : __pyx_v___pyx_PickleError = __pyx_t_1;
19012 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19013 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19014 :
19015 : /* "(tree fragment)":6
19016 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
19017 : * from pickle import PickleError as __pyx_PickleError
19018 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<<
19019 : * __pyx_result = Enum.__new__(__pyx_type)
19020 : * if __pyx_state is not None:
19021 : */
19022 0 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
19023 0 : __Pyx_GOTREF(__pyx_t_3);
19024 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
19025 0 : __Pyx_GOTREF(__pyx_t_1);
19026 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19027 0 : __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
19028 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19029 0 : __PYX_ERR(1, 6, __pyx_L1_error)
19030 :
19031 : /* "(tree fragment)":4
19032 : * cdef object __pyx_PickleError
19033 : * cdef object __pyx_result
19034 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
19035 : * from pickle import PickleError as __pyx_PickleError
19036 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19037 : */
19038 : }
19039 :
19040 : /* "(tree fragment)":7
19041 : * from pickle import PickleError as __pyx_PickleError
19042 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19043 : * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
19044 : * if __pyx_state is not None:
19045 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19046 : */
19047 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
19048 0 : __Pyx_GOTREF(__pyx_t_3);
19049 0 : __pyx_t_4 = NULL;
19050 0 : __pyx_t_5 = 0;
19051 : #if CYTHON_UNPACK_METHODS
19052 0 : if (likely(PyMethod_Check(__pyx_t_3))) {
19053 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
19054 0 : if (likely(__pyx_t_4)) {
19055 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19056 0 : __Pyx_INCREF(__pyx_t_4);
19057 0 : __Pyx_INCREF(function);
19058 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
19059 : __pyx_t_5 = 1;
19060 : }
19061 : }
19062 : #endif
19063 0 : {
19064 0 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
19065 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
19066 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
19067 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
19068 0 : __Pyx_GOTREF(__pyx_t_1);
19069 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19070 : }
19071 0 : __pyx_v___pyx_result = __pyx_t_1;
19072 0 : __pyx_t_1 = 0;
19073 :
19074 : /* "(tree fragment)":8
19075 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19076 : * __pyx_result = Enum.__new__(__pyx_type)
19077 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
19078 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19079 : * return __pyx_result
19080 : */
19081 0 : __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
19082 0 : if (__pyx_t_2) {
19083 :
19084 : /* "(tree fragment)":9
19085 : * __pyx_result = Enum.__new__(__pyx_type)
19086 : * if __pyx_state is not None:
19087 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
19088 : * return __pyx_result
19089 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19090 : */
19091 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
19092 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
19093 0 : __Pyx_GOTREF(__pyx_t_1);
19094 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19095 :
19096 : /* "(tree fragment)":8
19097 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
19098 : * __pyx_result = Enum.__new__(__pyx_type)
19099 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
19100 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19101 : * return __pyx_result
19102 : */
19103 : }
19104 :
19105 : /* "(tree fragment)":10
19106 : * if __pyx_state is not None:
19107 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19108 : * return __pyx_result # <<<<<<<<<<<<<<
19109 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19110 : * __pyx_result.name = __pyx_state[0]
19111 : */
19112 0 : __Pyx_XDECREF(__pyx_r);
19113 0 : __Pyx_INCREF(__pyx_v___pyx_result);
19114 0 : __pyx_r = __pyx_v___pyx_result;
19115 0 : goto __pyx_L0;
19116 :
19117 : /* "(tree fragment)":1
19118 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
19119 : * cdef object __pyx_PickleError
19120 : * cdef object __pyx_result
19121 : */
19122 :
19123 : /* function exit code */
19124 0 : __pyx_L1_error:;
19125 0 : __Pyx_XDECREF(__pyx_t_1);
19126 0 : __Pyx_XDECREF(__pyx_t_3);
19127 0 : __Pyx_XDECREF(__pyx_t_4);
19128 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
19129 0 : __pyx_r = NULL;
19130 0 : __pyx_L0:;
19131 0 : __Pyx_XDECREF(__pyx_v___pyx_PickleError);
19132 0 : __Pyx_XDECREF(__pyx_v___pyx_result);
19133 0 : __Pyx_XGIVEREF(__pyx_r);
19134 0 : __Pyx_RefNannyFinishContext();
19135 0 : return __pyx_r;
19136 : }
19137 :
19138 : /* "(tree fragment)":11
19139 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19140 : * return __pyx_result
19141 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19142 : * __pyx_result.name = __pyx_state[0]
19143 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19144 : */
19145 :
19146 0 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
19147 0 : PyObject *__pyx_r = NULL;
19148 : __Pyx_RefNannyDeclarations
19149 0 : PyObject *__pyx_t_1 = NULL;
19150 0 : int __pyx_t_2;
19151 0 : Py_ssize_t __pyx_t_3;
19152 0 : int __pyx_t_4;
19153 0 : PyObject *__pyx_t_5 = NULL;
19154 0 : PyObject *__pyx_t_6 = NULL;
19155 0 : PyObject *__pyx_t_7 = NULL;
19156 0 : unsigned int __pyx_t_8;
19157 0 : int __pyx_lineno = 0;
19158 0 : const char *__pyx_filename = NULL;
19159 0 : int __pyx_clineno = 0;
19160 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1);
19161 :
19162 : /* "(tree fragment)":12
19163 : * return __pyx_result
19164 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19165 : * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
19166 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19167 : * __pyx_result.__dict__.update(__pyx_state[1])
19168 : */
19169 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19170 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19171 0 : __PYX_ERR(1, 12, __pyx_L1_error)
19172 : }
19173 0 : __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
19174 0 : __Pyx_GOTREF(__pyx_t_1);
19175 0 : __Pyx_GIVEREF(__pyx_t_1);
19176 0 : __Pyx_GOTREF(__pyx_v___pyx_result->name);
19177 0 : __Pyx_DECREF(__pyx_v___pyx_result->name);
19178 0 : __pyx_v___pyx_result->name = __pyx_t_1;
19179 0 : __pyx_t_1 = 0;
19180 :
19181 : /* "(tree fragment)":13
19182 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19183 : * __pyx_result.name = __pyx_state[0]
19184 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
19185 : * __pyx_result.__dict__.update(__pyx_state[1])
19186 : */
19187 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19188 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
19189 : __PYX_ERR(1, 13, __pyx_L1_error)
19190 : }
19191 0 : __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
19192 0 : __pyx_t_4 = (__pyx_t_3 > 1);
19193 0 : if (__pyx_t_4) {
19194 : } else {
19195 0 : __pyx_t_2 = __pyx_t_4;
19196 0 : goto __pyx_L4_bool_binop_done;
19197 : }
19198 0 : __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
19199 : __pyx_t_2 = __pyx_t_4;
19200 0 : __pyx_L4_bool_binop_done:;
19201 0 : if (__pyx_t_2) {
19202 :
19203 : /* "(tree fragment)":14
19204 : * __pyx_result.name = __pyx_state[0]
19205 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19206 : * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
19207 : */
19208 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
19209 0 : __Pyx_GOTREF(__pyx_t_5);
19210 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
19211 0 : __Pyx_GOTREF(__pyx_t_6);
19212 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19213 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
19214 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
19215 : __PYX_ERR(1, 14, __pyx_L1_error)
19216 : }
19217 0 : __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
19218 0 : __Pyx_GOTREF(__pyx_t_5);
19219 0 : __pyx_t_7 = NULL;
19220 0 : __pyx_t_8 = 0;
19221 : #if CYTHON_UNPACK_METHODS
19222 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
19223 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
19224 0 : if (likely(__pyx_t_7)) {
19225 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19226 0 : __Pyx_INCREF(__pyx_t_7);
19227 0 : __Pyx_INCREF(function);
19228 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
19229 : __pyx_t_8 = 1;
19230 : }
19231 : }
19232 : #endif
19233 0 : {
19234 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
19235 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
19236 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
19237 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19238 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
19239 0 : __Pyx_GOTREF(__pyx_t_1);
19240 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19241 : }
19242 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19243 :
19244 : /* "(tree fragment)":13
19245 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
19246 : * __pyx_result.name = __pyx_state[0]
19247 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
19248 : * __pyx_result.__dict__.update(__pyx_state[1])
19249 : */
19250 : }
19251 :
19252 : /* "(tree fragment)":11
19253 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
19254 : * return __pyx_result
19255 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
19256 : * __pyx_result.name = __pyx_state[0]
19257 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
19258 : */
19259 :
19260 : /* function exit code */
19261 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19262 0 : goto __pyx_L0;
19263 0 : __pyx_L1_error:;
19264 0 : __Pyx_XDECREF(__pyx_t_1);
19265 0 : __Pyx_XDECREF(__pyx_t_5);
19266 0 : __Pyx_XDECREF(__pyx_t_6);
19267 0 : __Pyx_XDECREF(__pyx_t_7);
19268 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
19269 0 : __pyx_r = 0;
19270 0 : __pyx_L0:;
19271 0 : __Pyx_XGIVEREF(__pyx_r);
19272 0 : __Pyx_RefNannyFinishContext();
19273 0 : return __pyx_r;
19274 : }
19275 :
19276 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
19277 : *
19278 : * @property
19279 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
19280 : * return PyDataType_ELSIZE(self)
19281 : *
19282 : */
19283 :
19284 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
19285 : npy_intp __pyx_r;
19286 :
19287 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
19288 : * @property
19289 : * cdef inline npy_intp itemsize(self) noexcept nogil:
19290 : * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
19291 : *
19292 : * @property
19293 : */
19294 : __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
19295 : goto __pyx_L0;
19296 :
19297 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
19298 : *
19299 : * @property
19300 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
19301 : * return PyDataType_ELSIZE(self)
19302 : *
19303 : */
19304 :
19305 : /* function exit code */
19306 : __pyx_L0:;
19307 : return __pyx_r;
19308 : }
19309 :
19310 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
19311 : *
19312 : * @property
19313 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
19314 : * return PyDataType_ALIGNMENT(self)
19315 : *
19316 : */
19317 :
19318 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
19319 : npy_intp __pyx_r;
19320 :
19321 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
19322 : * @property
19323 : * cdef inline npy_intp alignment(self) noexcept nogil:
19324 : * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
19325 : *
19326 : * # Use fields/names with care as they may be NULL. You must check
19327 : */
19328 : __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
19329 : goto __pyx_L0;
19330 :
19331 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
19332 : *
19333 : * @property
19334 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
19335 : * return PyDataType_ALIGNMENT(self)
19336 : *
19337 : */
19338 :
19339 : /* function exit code */
19340 : __pyx_L0:;
19341 : return __pyx_r;
19342 : }
19343 :
19344 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
19345 : * # for this using PyDataType_HASFIELDS.
19346 : * @property
19347 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
19348 : * return <object>PyDataType_FIELDS(self)
19349 : *
19350 : */
19351 :
19352 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
19353 : PyObject *__pyx_r = NULL;
19354 : __Pyx_RefNannyDeclarations
19355 : PyObject *__pyx_t_1;
19356 : __Pyx_RefNannySetupContext("fields", 1);
19357 :
19358 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
19359 : * @property
19360 : * cdef inline object fields(self):
19361 : * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
19362 : *
19363 : * @property
19364 : */
19365 : __Pyx_XDECREF(__pyx_r);
19366 : __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
19367 : __Pyx_INCREF(((PyObject *)__pyx_t_1));
19368 : __pyx_r = ((PyObject *)__pyx_t_1);
19369 : goto __pyx_L0;
19370 :
19371 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
19372 : * # for this using PyDataType_HASFIELDS.
19373 : * @property
19374 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
19375 : * return <object>PyDataType_FIELDS(self)
19376 : *
19377 : */
19378 :
19379 : /* function exit code */
19380 : __pyx_L0:;
19381 : __Pyx_XGIVEREF(__pyx_r);
19382 : __Pyx_RefNannyFinishContext();
19383 : return __pyx_r;
19384 : }
19385 :
19386 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
19387 : *
19388 : * @property
19389 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
19390 : * return <tuple>PyDataType_NAMES(self)
19391 : *
19392 : */
19393 :
19394 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
19395 : PyObject *__pyx_r = NULL;
19396 : __Pyx_RefNannyDeclarations
19397 : PyObject *__pyx_t_1;
19398 : __Pyx_RefNannySetupContext("names", 1);
19399 :
19400 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
19401 : * @property
19402 : * cdef inline tuple names(self):
19403 : * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
19404 : *
19405 : * # Use PyDataType_HASSUBARRAY to test whether this field is
19406 : */
19407 : __Pyx_XDECREF(__pyx_r);
19408 : __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
19409 : __Pyx_INCREF(((PyObject*)__pyx_t_1));
19410 : __pyx_r = ((PyObject*)__pyx_t_1);
19411 : goto __pyx_L0;
19412 :
19413 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
19414 : *
19415 : * @property
19416 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
19417 : * return <tuple>PyDataType_NAMES(self)
19418 : *
19419 : */
19420 :
19421 : /* function exit code */
19422 : __pyx_L0:;
19423 : __Pyx_XGIVEREF(__pyx_r);
19424 : __Pyx_RefNannyFinishContext();
19425 : return __pyx_r;
19426 : }
19427 :
19428 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
19429 : * # this field via the inline helper method PyDataType_SHAPE.
19430 : * @property
19431 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
19432 : * return PyDataType_SUBARRAY(self)
19433 : *
19434 : */
19435 :
19436 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
19437 : PyArray_ArrayDescr *__pyx_r;
19438 :
19439 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
19440 : * @property
19441 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
19442 : * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
19443 : *
19444 : * @property
19445 : */
19446 : __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
19447 : goto __pyx_L0;
19448 :
19449 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
19450 : * # this field via the inline helper method PyDataType_SHAPE.
19451 : * @property
19452 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
19453 : * return PyDataType_SUBARRAY(self)
19454 : *
19455 : */
19456 :
19457 : /* function exit code */
19458 : __pyx_L0:;
19459 : return __pyx_r;
19460 : }
19461 :
19462 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
19463 : *
19464 : * @property
19465 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
19466 : * """The data types flags."""
19467 : * return PyDataType_FLAGS(self)
19468 : */
19469 :
19470 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
19471 : npy_uint64 __pyx_r;
19472 :
19473 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
19474 : * cdef inline npy_uint64 flags(self) noexcept nogil:
19475 : * """The data types flags."""
19476 : * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
19477 : *
19478 : *
19479 : */
19480 : __pyx_r = PyDataType_FLAGS(__pyx_v_self);
19481 : goto __pyx_L0;
19482 :
19483 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
19484 : *
19485 : * @property
19486 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
19487 : * """The data types flags."""
19488 : * return PyDataType_FLAGS(self)
19489 : */
19490 :
19491 : /* function exit code */
19492 : __pyx_L0:;
19493 : return __pyx_r;
19494 : }
19495 :
19496 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
19497 : *
19498 : * @property
19499 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
19500 : * """The number of arrays that need to be broadcast to the same shape."""
19501 : * return PyArray_MultiIter_NUMITER(self)
19502 : */
19503 :
19504 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
19505 : int __pyx_r;
19506 :
19507 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
19508 : * cdef inline int numiter(self) noexcept nogil:
19509 : * """The number of arrays that need to be broadcast to the same shape."""
19510 : * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
19511 : *
19512 : * @property
19513 : */
19514 : __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
19515 : goto __pyx_L0;
19516 :
19517 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
19518 : *
19519 : * @property
19520 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
19521 : * """The number of arrays that need to be broadcast to the same shape."""
19522 : * return PyArray_MultiIter_NUMITER(self)
19523 : */
19524 :
19525 : /* function exit code */
19526 : __pyx_L0:;
19527 : return __pyx_r;
19528 : }
19529 :
19530 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
19531 : *
19532 : * @property
19533 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19534 : * """The total broadcasted size."""
19535 : * return PyArray_MultiIter_SIZE(self)
19536 : */
19537 :
19538 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
19539 : npy_intp __pyx_r;
19540 :
19541 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
19542 : * cdef inline npy_intp size(self) noexcept nogil:
19543 : * """The total broadcasted size."""
19544 : * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
19545 : *
19546 : * @property
19547 : */
19548 : __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
19549 : goto __pyx_L0;
19550 :
19551 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
19552 : *
19553 : * @property
19554 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19555 : * """The total broadcasted size."""
19556 : * return PyArray_MultiIter_SIZE(self)
19557 : */
19558 :
19559 : /* function exit code */
19560 : __pyx_L0:;
19561 : return __pyx_r;
19562 : }
19563 :
19564 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
19565 : *
19566 : * @property
19567 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
19568 : * """The current (1-d) index into the broadcasted result."""
19569 : * return PyArray_MultiIter_INDEX(self)
19570 : */
19571 :
19572 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
19573 : npy_intp __pyx_r;
19574 :
19575 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
19576 : * cdef inline npy_intp index(self) noexcept nogil:
19577 : * """The current (1-d) index into the broadcasted result."""
19578 : * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
19579 : *
19580 : * @property
19581 : */
19582 : __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
19583 : goto __pyx_L0;
19584 :
19585 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
19586 : *
19587 : * @property
19588 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
19589 : * """The current (1-d) index into the broadcasted result."""
19590 : * return PyArray_MultiIter_INDEX(self)
19591 : */
19592 :
19593 : /* function exit code */
19594 : __pyx_L0:;
19595 : return __pyx_r;
19596 : }
19597 :
19598 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
19599 : *
19600 : * @property
19601 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
19602 : * """The number of dimensions in the broadcasted result."""
19603 : * return PyArray_MultiIter_NDIM(self)
19604 : */
19605 :
19606 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
19607 : int __pyx_r;
19608 :
19609 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
19610 : * cdef inline int nd(self) noexcept nogil:
19611 : * """The number of dimensions in the broadcasted result."""
19612 : * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
19613 : *
19614 : * @property
19615 : */
19616 : __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
19617 : goto __pyx_L0;
19618 :
19619 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
19620 : *
19621 : * @property
19622 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
19623 : * """The number of dimensions in the broadcasted result."""
19624 : * return PyArray_MultiIter_NDIM(self)
19625 : */
19626 :
19627 : /* function exit code */
19628 : __pyx_L0:;
19629 : return __pyx_r;
19630 : }
19631 :
19632 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
19633 : *
19634 : * @property
19635 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
19636 : * """The shape of the broadcasted result."""
19637 : * return PyArray_MultiIter_DIMS(self)
19638 : */
19639 :
19640 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
19641 : npy_intp *__pyx_r;
19642 :
19643 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
19644 : * cdef inline npy_intp* dimensions(self) noexcept nogil:
19645 : * """The shape of the broadcasted result."""
19646 : * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
19647 : *
19648 : * @property
19649 : */
19650 : __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
19651 : goto __pyx_L0;
19652 :
19653 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
19654 : *
19655 : * @property
19656 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
19657 : * """The shape of the broadcasted result."""
19658 : * return PyArray_MultiIter_DIMS(self)
19659 : */
19660 :
19661 : /* function exit code */
19662 : __pyx_L0:;
19663 : return __pyx_r;
19664 : }
19665 :
19666 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
19667 : *
19668 : * @property
19669 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
19670 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19671 : * On return, the iterators are adjusted for broadcasting."""
19672 : */
19673 :
19674 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
19675 : void **__pyx_r;
19676 :
19677 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
19678 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19679 : * On return, the iterators are adjusted for broadcasting."""
19680 : * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
19681 : *
19682 : *
19683 : */
19684 : __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
19685 : goto __pyx_L0;
19686 :
19687 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
19688 : *
19689 : * @property
19690 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
19691 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
19692 : * On return, the iterators are adjusted for broadcasting."""
19693 : */
19694 :
19695 : /* function exit code */
19696 : __pyx_L0:;
19697 : return __pyx_r;
19698 : }
19699 :
19700 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
19701 : *
19702 : * @property
19703 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
19704 : * """Returns a borrowed reference to the object owning the data/memory.
19705 : * """
19706 : */
19707 :
19708 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
19709 : PyObject *__pyx_r;
19710 :
19711 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
19712 : * """Returns a borrowed reference to the object owning the data/memory.
19713 : * """
19714 : * return PyArray_BASE(self) # <<<<<<<<<<<<<<
19715 : *
19716 : * @property
19717 : */
19718 : __pyx_r = PyArray_BASE(__pyx_v_self);
19719 : goto __pyx_L0;
19720 :
19721 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
19722 : *
19723 : * @property
19724 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
19725 : * """Returns a borrowed reference to the object owning the data/memory.
19726 : * """
19727 : */
19728 :
19729 : /* function exit code */
19730 : __pyx_L0:;
19731 : return __pyx_r;
19732 : }
19733 :
19734 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
19735 : *
19736 : * @property
19737 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
19738 : * """Returns an owned reference to the dtype of the array.
19739 : * """
19740 : */
19741 :
19742 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
19743 : PyArray_Descr *__pyx_r = NULL;
19744 : __Pyx_RefNannyDeclarations
19745 : PyArray_Descr *__pyx_t_1;
19746 : __Pyx_RefNannySetupContext("descr", 1);
19747 :
19748 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
19749 : * """Returns an owned reference to the dtype of the array.
19750 : * """
19751 : * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
19752 : *
19753 : * @property
19754 : */
19755 : __Pyx_XDECREF((PyObject *)__pyx_r);
19756 : __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
19757 : __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
19758 : __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19759 : goto __pyx_L0;
19760 :
19761 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
19762 : *
19763 : * @property
19764 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
19765 : * """Returns an owned reference to the dtype of the array.
19766 : * """
19767 : */
19768 :
19769 : /* function exit code */
19770 : __pyx_L0:;
19771 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
19772 : __Pyx_RefNannyFinishContext();
19773 : return __pyx_r;
19774 : }
19775 :
19776 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
19777 : *
19778 : * @property
19779 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
19780 : * """Returns the number of dimensions in the array.
19781 : * """
19782 : */
19783 :
19784 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
19785 : int __pyx_r;
19786 :
19787 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
19788 : * """Returns the number of dimensions in the array.
19789 : * """
19790 : * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
19791 : *
19792 : * @property
19793 : */
19794 : __pyx_r = PyArray_NDIM(__pyx_v_self);
19795 : goto __pyx_L0;
19796 :
19797 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
19798 : *
19799 : * @property
19800 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
19801 : * """Returns the number of dimensions in the array.
19802 : * """
19803 : */
19804 :
19805 : /* function exit code */
19806 : __pyx_L0:;
19807 : return __pyx_r;
19808 : }
19809 :
19810 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
19811 : *
19812 : * @property
19813 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
19814 : * """Returns a pointer to the dimensions/shape of the array.
19815 : * The number of elements matches the number of dimensions of the array (ndim).
19816 : */
19817 :
19818 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
19819 : npy_intp *__pyx_r;
19820 :
19821 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
19822 : * Can return NULL for 0-dimensional arrays.
19823 : * """
19824 : * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
19825 : *
19826 : * @property
19827 : */
19828 : __pyx_r = PyArray_DIMS(__pyx_v_self);
19829 : goto __pyx_L0;
19830 :
19831 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
19832 : *
19833 : * @property
19834 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
19835 : * """Returns a pointer to the dimensions/shape of the array.
19836 : * The number of elements matches the number of dimensions of the array (ndim).
19837 : */
19838 :
19839 : /* function exit code */
19840 : __pyx_L0:;
19841 : return __pyx_r;
19842 : }
19843 :
19844 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
19845 : *
19846 : * @property
19847 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
19848 : * """Returns a pointer to the strides of the array.
19849 : * The number of elements matches the number of dimensions of the array (ndim).
19850 : */
19851 :
19852 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
19853 : npy_intp *__pyx_r;
19854 :
19855 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
19856 : * The number of elements matches the number of dimensions of the array (ndim).
19857 : * """
19858 : * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
19859 : *
19860 : * @property
19861 : */
19862 : __pyx_r = PyArray_STRIDES(__pyx_v_self);
19863 : goto __pyx_L0;
19864 :
19865 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
19866 : *
19867 : * @property
19868 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
19869 : * """Returns a pointer to the strides of the array.
19870 : * The number of elements matches the number of dimensions of the array (ndim).
19871 : */
19872 :
19873 : /* function exit code */
19874 : __pyx_L0:;
19875 : return __pyx_r;
19876 : }
19877 :
19878 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
19879 : *
19880 : * @property
19881 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19882 : * """Returns the total size (in number of elements) of the array.
19883 : * """
19884 : */
19885 :
19886 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
19887 : npy_intp __pyx_r;
19888 :
19889 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
19890 : * """Returns the total size (in number of elements) of the array.
19891 : * """
19892 : * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
19893 : *
19894 : * @property
19895 : */
19896 : __pyx_r = PyArray_SIZE(__pyx_v_self);
19897 : goto __pyx_L0;
19898 :
19899 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
19900 : *
19901 : * @property
19902 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
19903 : * """Returns the total size (in number of elements) of the array.
19904 : * """
19905 : */
19906 :
19907 : /* function exit code */
19908 : __pyx_L0:;
19909 : return __pyx_r;
19910 : }
19911 :
19912 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19913 : *
19914 : * @property
19915 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19916 : * """The pointer to the data buffer as a char*.
19917 : * This is provided for legacy reasons to avoid direct struct field access.
19918 : */
19919 :
19920 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
19921 : char *__pyx_r;
19922 :
19923 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
19924 : * of `PyArray_DATA()` instead, which returns a 'void*'.
19925 : * """
19926 : * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19927 : *
19928 : *
19929 : */
19930 : __pyx_r = PyArray_BYTES(__pyx_v_self);
19931 : goto __pyx_L0;
19932 :
19933 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19934 : *
19935 : * @property
19936 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19937 : * """The pointer to the data buffer as a char*.
19938 : * This is provided for legacy reasons to avoid direct struct field access.
19939 : */
19940 :
19941 : /* function exit code */
19942 : __pyx_L0:;
19943 : return __pyx_r;
19944 : }
19945 :
19946 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19947 : * ctypedef long double complex clongdouble_t
19948 : *
19949 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19950 : * return PyArray_MultiIterNew(1, <void*>a)
19951 : *
19952 : */
19953 :
19954 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19955 : PyObject *__pyx_r = NULL;
19956 : __Pyx_RefNannyDeclarations
19957 : PyObject *__pyx_t_1 = NULL;
19958 : int __pyx_lineno = 0;
19959 : const char *__pyx_filename = NULL;
19960 : int __pyx_clineno = 0;
19961 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19962 :
19963 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
19964 : *
19965 : * cdef inline object PyArray_MultiIterNew1(a):
19966 : * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19967 : *
19968 : * cdef inline object PyArray_MultiIterNew2(a, b):
19969 : */
19970 : __Pyx_XDECREF(__pyx_r);
19971 : __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
19972 : __Pyx_GOTREF(__pyx_t_1);
19973 : __pyx_r = __pyx_t_1;
19974 : __pyx_t_1 = 0;
19975 : goto __pyx_L0;
19976 :
19977 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19978 : * ctypedef long double complex clongdouble_t
19979 : *
19980 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19981 : * return PyArray_MultiIterNew(1, <void*>a)
19982 : *
19983 : */
19984 :
19985 : /* function exit code */
19986 : __pyx_L1_error:;
19987 : __Pyx_XDECREF(__pyx_t_1);
19988 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19989 : __pyx_r = 0;
19990 : __pyx_L0:;
19991 : __Pyx_XGIVEREF(__pyx_r);
19992 : __Pyx_RefNannyFinishContext();
19993 : return __pyx_r;
19994 : }
19995 :
19996 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19997 : * return PyArray_MultiIterNew(1, <void*>a)
19998 : *
19999 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
20000 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20001 : *
20002 : */
20003 :
20004 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
20005 : PyObject *__pyx_r = NULL;
20006 : __Pyx_RefNannyDeclarations
20007 : PyObject *__pyx_t_1 = NULL;
20008 : int __pyx_lineno = 0;
20009 : const char *__pyx_filename = NULL;
20010 : int __pyx_clineno = 0;
20011 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
20012 :
20013 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
20014 : *
20015 : * cdef inline object PyArray_MultiIterNew2(a, b):
20016 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
20017 : *
20018 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
20019 : */
20020 : __Pyx_XDECREF(__pyx_r);
20021 : __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error)
20022 : __Pyx_GOTREF(__pyx_t_1);
20023 : __pyx_r = __pyx_t_1;
20024 : __pyx_t_1 = 0;
20025 : goto __pyx_L0;
20026 :
20027 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
20028 : * return PyArray_MultiIterNew(1, <void*>a)
20029 : *
20030 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
20031 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20032 : *
20033 : */
20034 :
20035 : /* function exit code */
20036 : __pyx_L1_error:;
20037 : __Pyx_XDECREF(__pyx_t_1);
20038 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
20039 : __pyx_r = 0;
20040 : __pyx_L0:;
20041 : __Pyx_XGIVEREF(__pyx_r);
20042 : __Pyx_RefNannyFinishContext();
20043 : return __pyx_r;
20044 : }
20045 :
20046 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
20047 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20048 : *
20049 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
20050 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20051 : *
20052 : */
20053 :
20054 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
20055 : PyObject *__pyx_r = NULL;
20056 : __Pyx_RefNannyDeclarations
20057 : PyObject *__pyx_t_1 = NULL;
20058 : int __pyx_lineno = 0;
20059 : const char *__pyx_filename = NULL;
20060 : int __pyx_clineno = 0;
20061 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
20062 :
20063 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
20064 : *
20065 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
20066 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
20067 : *
20068 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
20069 : */
20070 : __Pyx_XDECREF(__pyx_r);
20071 : __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error)
20072 : __Pyx_GOTREF(__pyx_t_1);
20073 : __pyx_r = __pyx_t_1;
20074 : __pyx_t_1 = 0;
20075 : goto __pyx_L0;
20076 :
20077 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
20078 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
20079 : *
20080 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
20081 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20082 : *
20083 : */
20084 :
20085 : /* function exit code */
20086 : __pyx_L1_error:;
20087 : __Pyx_XDECREF(__pyx_t_1);
20088 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20089 : __pyx_r = 0;
20090 : __pyx_L0:;
20091 : __Pyx_XGIVEREF(__pyx_r);
20092 : __Pyx_RefNannyFinishContext();
20093 : return __pyx_r;
20094 : }
20095 :
20096 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
20097 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20098 : *
20099 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20100 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20101 : *
20102 : */
20103 :
20104 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
20105 : PyObject *__pyx_r = NULL;
20106 : __Pyx_RefNannyDeclarations
20107 : PyObject *__pyx_t_1 = NULL;
20108 : int __pyx_lineno = 0;
20109 : const char *__pyx_filename = NULL;
20110 : int __pyx_clineno = 0;
20111 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
20112 :
20113 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
20114 : *
20115 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
20116 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
20117 : *
20118 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20119 : */
20120 : __Pyx_XDECREF(__pyx_r);
20121 : __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error)
20122 : __Pyx_GOTREF(__pyx_t_1);
20123 : __pyx_r = __pyx_t_1;
20124 : __pyx_t_1 = 0;
20125 : goto __pyx_L0;
20126 :
20127 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
20128 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
20129 : *
20130 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
20131 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20132 : *
20133 : */
20134 :
20135 : /* function exit code */
20136 : __pyx_L1_error:;
20137 : __Pyx_XDECREF(__pyx_t_1);
20138 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20139 : __pyx_r = 0;
20140 : __pyx_L0:;
20141 : __Pyx_XGIVEREF(__pyx_r);
20142 : __Pyx_RefNannyFinishContext();
20143 : return __pyx_r;
20144 : }
20145 :
20146 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
20147 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20148 : *
20149 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20150 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20151 : *
20152 : */
20153 :
20154 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
20155 : PyObject *__pyx_r = NULL;
20156 : __Pyx_RefNannyDeclarations
20157 : PyObject *__pyx_t_1 = NULL;
20158 : int __pyx_lineno = 0;
20159 : const char *__pyx_filename = NULL;
20160 : int __pyx_clineno = 0;
20161 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
20162 :
20163 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
20164 : *
20165 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
20166 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
20167 : *
20168 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20169 : */
20170 : __Pyx_XDECREF(__pyx_r);
20171 : __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error)
20172 : __Pyx_GOTREF(__pyx_t_1);
20173 : __pyx_r = __pyx_t_1;
20174 : __pyx_t_1 = 0;
20175 : goto __pyx_L0;
20176 :
20177 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
20178 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
20179 : *
20180 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
20181 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20182 : *
20183 : */
20184 :
20185 : /* function exit code */
20186 : __pyx_L1_error:;
20187 : __Pyx_XDECREF(__pyx_t_1);
20188 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
20189 : __pyx_r = 0;
20190 : __pyx_L0:;
20191 : __Pyx_XGIVEREF(__pyx_r);
20192 : __Pyx_RefNannyFinishContext();
20193 : return __pyx_r;
20194 : }
20195 :
20196 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
20197 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20198 : *
20199 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20200 : * if PyDataType_HASSUBARRAY(d):
20201 : * return <tuple>d.subarray.shape
20202 : */
20203 :
20204 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
20205 : PyObject *__pyx_r = NULL;
20206 : __Pyx_RefNannyDeclarations
20207 : int __pyx_t_1;
20208 : PyObject *__pyx_t_2;
20209 : __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
20210 :
20211 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
20212 : *
20213 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20214 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20215 : * return <tuple>d.subarray.shape
20216 : * else:
20217 : */
20218 : __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20219 : if (__pyx_t_1) {
20220 :
20221 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
20222 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20223 : * if PyDataType_HASSUBARRAY(d):
20224 : * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
20225 : * else:
20226 : * return ()
20227 : */
20228 : __Pyx_XDECREF(__pyx_r);
20229 : __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
20230 : __Pyx_INCREF(((PyObject*)__pyx_t_2));
20231 : __pyx_r = ((PyObject*)__pyx_t_2);
20232 : goto __pyx_L0;
20233 :
20234 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
20235 : *
20236 : * cdef inline tuple PyDataType_SHAPE(dtype d):
20237 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
20238 : * return <tuple>d.subarray.shape
20239 : * else:
20240 : */
20241 : }
20242 :
20243 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
20244 : * return <tuple>d.subarray.shape
20245 : * else:
20246 : * return () # <<<<<<<<<<<<<<
20247 : *
20248 : *
20249 : */
20250 : /*else*/ {
20251 : __Pyx_XDECREF(__pyx_r);
20252 : __Pyx_INCREF(__pyx_empty_tuple);
20253 : __pyx_r = __pyx_empty_tuple;
20254 : goto __pyx_L0;
20255 : }
20256 :
20257 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
20258 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20259 : *
20260 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
20261 : * if PyDataType_HASSUBARRAY(d):
20262 : * return <tuple>d.subarray.shape
20263 : */
20264 :
20265 : /* function exit code */
20266 : __pyx_L0:;
20267 : __Pyx_XGIVEREF(__pyx_r);
20268 : __Pyx_RefNannyFinishContext();
20269 : return __pyx_r;
20270 : }
20271 :
20272 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
20273 : * int _import_umath() except -1
20274 : *
20275 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20276 : * Py_INCREF(base) # important to do this before stealing the reference below!
20277 : * PyArray_SetBaseObject(arr, base)
20278 : */
20279 :
20280 : static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20281 : int __pyx_t_1;
20282 : int __pyx_lineno = 0;
20283 : const char *__pyx_filename = NULL;
20284 : int __pyx_clineno = 0;
20285 :
20286 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
20287 : *
20288 : * cdef inline void set_array_base(ndarray arr, object base) except *:
20289 : * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
20290 : * PyArray_SetBaseObject(arr, base)
20291 : *
20292 : */
20293 : Py_INCREF(__pyx_v_base);
20294 :
20295 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
20296 : * cdef inline void set_array_base(ndarray arr, object base) except *:
20297 : * Py_INCREF(base) # important to do this before stealing the reference below!
20298 : * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
20299 : *
20300 : * cdef inline object get_array_base(ndarray arr):
20301 : */
20302 : __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error)
20303 :
20304 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
20305 : * int _import_umath() except -1
20306 : *
20307 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
20308 : * Py_INCREF(base) # important to do this before stealing the reference below!
20309 : * PyArray_SetBaseObject(arr, base)
20310 : */
20311 :
20312 : /* function exit code */
20313 : goto __pyx_L0;
20314 : __pyx_L1_error:;
20315 : __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
20316 : __pyx_L0:;
20317 : }
20318 :
20319 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
20320 : * PyArray_SetBaseObject(arr, base)
20321 : *
20322 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20323 : * base = PyArray_BASE(arr)
20324 : * if base is NULL:
20325 : */
20326 :
20327 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
20328 : PyObject *__pyx_v_base;
20329 : PyObject *__pyx_r = NULL;
20330 : __Pyx_RefNannyDeclarations
20331 : int __pyx_t_1;
20332 : __Pyx_RefNannySetupContext("get_array_base", 1);
20333 :
20334 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
20335 : *
20336 : * cdef inline object get_array_base(ndarray arr):
20337 : * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
20338 : * if base is NULL:
20339 : * return None
20340 : */
20341 : __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20342 :
20343 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
20344 : * cdef inline object get_array_base(ndarray arr):
20345 : * base = PyArray_BASE(arr)
20346 : * if base is NULL: # <<<<<<<<<<<<<<
20347 : * return None
20348 : * return <object>base
20349 : */
20350 : __pyx_t_1 = (__pyx_v_base == NULL);
20351 : if (__pyx_t_1) {
20352 :
20353 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
20354 : * base = PyArray_BASE(arr)
20355 : * if base is NULL:
20356 : * return None # <<<<<<<<<<<<<<
20357 : * return <object>base
20358 : *
20359 : */
20360 : __Pyx_XDECREF(__pyx_r);
20361 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20362 : goto __pyx_L0;
20363 :
20364 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
20365 : * cdef inline object get_array_base(ndarray arr):
20366 : * base = PyArray_BASE(arr)
20367 : * if base is NULL: # <<<<<<<<<<<<<<
20368 : * return None
20369 : * return <object>base
20370 : */
20371 : }
20372 :
20373 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
20374 : * if base is NULL:
20375 : * return None
20376 : * return <object>base # <<<<<<<<<<<<<<
20377 : *
20378 : * # Versions of the import_* functions which are more suitable for
20379 : */
20380 : __Pyx_XDECREF(__pyx_r);
20381 : __Pyx_INCREF(((PyObject *)__pyx_v_base));
20382 : __pyx_r = ((PyObject *)__pyx_v_base);
20383 : goto __pyx_L0;
20384 :
20385 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
20386 : * PyArray_SetBaseObject(arr, base)
20387 : *
20388 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
20389 : * base = PyArray_BASE(arr)
20390 : * if base is NULL:
20391 : */
20392 :
20393 : /* function exit code */
20394 : __pyx_L0:;
20395 : __Pyx_XGIVEREF(__pyx_r);
20396 : __Pyx_RefNannyFinishContext();
20397 : return __pyx_r;
20398 : }
20399 :
20400 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
20401 : * # Versions of the import_* functions which are more suitable for
20402 : * # Cython code.
20403 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20404 : * try:
20405 : * __pyx_import_array()
20406 : */
20407 :
20408 3 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20409 3 : int __pyx_r;
20410 : __Pyx_RefNannyDeclarations
20411 3 : PyObject *__pyx_t_1 = NULL;
20412 3 : PyObject *__pyx_t_2 = NULL;
20413 3 : PyObject *__pyx_t_3 = NULL;
20414 3 : int __pyx_t_4;
20415 3 : PyObject *__pyx_t_5 = NULL;
20416 3 : PyObject *__pyx_t_6 = NULL;
20417 3 : PyObject *__pyx_t_7 = NULL;
20418 3 : PyObject *__pyx_t_8 = NULL;
20419 3 : int __pyx_lineno = 0;
20420 3 : const char *__pyx_filename = NULL;
20421 3 : int __pyx_clineno = 0;
20422 3 : __Pyx_RefNannySetupContext("import_array", 1);
20423 :
20424 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
20425 : * # Cython code.
20426 : * cdef inline int import_array() except -1:
20427 : * try: # <<<<<<<<<<<<<<
20428 : * __pyx_import_array()
20429 : * except Exception:
20430 : */
20431 3 : {
20432 3 : __Pyx_PyThreadState_declare
20433 3 : __Pyx_PyThreadState_assign
20434 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20435 3 : __Pyx_XGOTREF(__pyx_t_1);
20436 3 : __Pyx_XGOTREF(__pyx_t_2);
20437 3 : __Pyx_XGOTREF(__pyx_t_3);
20438 3 : /*try:*/ {
20439 :
20440 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
20441 : * cdef inline int import_array() except -1:
20442 : * try:
20443 : * __pyx_import_array() # <<<<<<<<<<<<<<
20444 : * except Exception:
20445 : * raise ImportError("numpy._core.multiarray failed to import")
20446 : */
20447 3 : __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error)
20448 :
20449 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
20450 : * # Cython code.
20451 : * cdef inline int import_array() except -1:
20452 : * try: # <<<<<<<<<<<<<<
20453 : * __pyx_import_array()
20454 : * except Exception:
20455 : */
20456 : }
20457 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20458 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20459 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20460 3 : goto __pyx_L8_try_end;
20461 0 : __pyx_L3_error:;
20462 :
20463 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
20464 : * try:
20465 : * __pyx_import_array()
20466 : * except Exception: # <<<<<<<<<<<<<<
20467 : * raise ImportError("numpy._core.multiarray failed to import")
20468 : *
20469 : */
20470 0 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20471 0 : if (__pyx_t_4) {
20472 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20473 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error)
20474 0 : __Pyx_XGOTREF(__pyx_t_5);
20475 0 : __Pyx_XGOTREF(__pyx_t_6);
20476 0 : __Pyx_XGOTREF(__pyx_t_7);
20477 :
20478 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
20479 : * __pyx_import_array()
20480 : * except Exception:
20481 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
20482 : *
20483 : * cdef inline int import_umath() except -1:
20484 : */
20485 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error)
20486 0 : __Pyx_GOTREF(__pyx_t_8);
20487 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20488 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20489 0 : __PYX_ERR(2, 1025, __pyx_L5_except_error)
20490 : }
20491 0 : goto __pyx_L5_except_error;
20492 :
20493 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
20494 : * # Cython code.
20495 : * cdef inline int import_array() except -1:
20496 : * try: # <<<<<<<<<<<<<<
20497 : * __pyx_import_array()
20498 : * except Exception:
20499 : */
20500 0 : __pyx_L5_except_error:;
20501 0 : __Pyx_XGIVEREF(__pyx_t_1);
20502 0 : __Pyx_XGIVEREF(__pyx_t_2);
20503 0 : __Pyx_XGIVEREF(__pyx_t_3);
20504 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20505 0 : goto __pyx_L1_error;
20506 3 : __pyx_L8_try_end:;
20507 : }
20508 :
20509 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
20510 : * # Versions of the import_* functions which are more suitable for
20511 : * # Cython code.
20512 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
20513 : * try:
20514 : * __pyx_import_array()
20515 : */
20516 :
20517 : /* function exit code */
20518 3 : __pyx_r = 0;
20519 3 : goto __pyx_L0;
20520 0 : __pyx_L1_error:;
20521 0 : __Pyx_XDECREF(__pyx_t_5);
20522 0 : __Pyx_XDECREF(__pyx_t_6);
20523 0 : __Pyx_XDECREF(__pyx_t_7);
20524 0 : __Pyx_XDECREF(__pyx_t_8);
20525 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
20526 : __pyx_r = -1;
20527 3 : __pyx_L0:;
20528 3 : __Pyx_RefNannyFinishContext();
20529 3 : return __pyx_r;
20530 : }
20531 :
20532 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
20533 : * raise ImportError("numpy._core.multiarray failed to import")
20534 : *
20535 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20536 : * try:
20537 : * _import_umath()
20538 : */
20539 :
20540 : static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20541 : int __pyx_r;
20542 : __Pyx_RefNannyDeclarations
20543 : PyObject *__pyx_t_1 = NULL;
20544 : PyObject *__pyx_t_2 = NULL;
20545 : PyObject *__pyx_t_3 = NULL;
20546 : int __pyx_t_4;
20547 : PyObject *__pyx_t_5 = NULL;
20548 : PyObject *__pyx_t_6 = NULL;
20549 : PyObject *__pyx_t_7 = NULL;
20550 : PyObject *__pyx_t_8 = NULL;
20551 : int __pyx_lineno = 0;
20552 : const char *__pyx_filename = NULL;
20553 : int __pyx_clineno = 0;
20554 : __Pyx_RefNannySetupContext("import_umath", 1);
20555 :
20556 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
20557 : *
20558 : * cdef inline int import_umath() except -1:
20559 : * try: # <<<<<<<<<<<<<<
20560 : * _import_umath()
20561 : * except Exception:
20562 : */
20563 : {
20564 : __Pyx_PyThreadState_declare
20565 : __Pyx_PyThreadState_assign
20566 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20567 : __Pyx_XGOTREF(__pyx_t_1);
20568 : __Pyx_XGOTREF(__pyx_t_2);
20569 : __Pyx_XGOTREF(__pyx_t_3);
20570 : /*try:*/ {
20571 :
20572 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
20573 : * cdef inline int import_umath() except -1:
20574 : * try:
20575 : * _import_umath() # <<<<<<<<<<<<<<
20576 : * except Exception:
20577 : * raise ImportError("numpy._core.umath failed to import")
20578 : */
20579 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error)
20580 :
20581 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
20582 : *
20583 : * cdef inline int import_umath() except -1:
20584 : * try: # <<<<<<<<<<<<<<
20585 : * _import_umath()
20586 : * except Exception:
20587 : */
20588 : }
20589 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20590 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20591 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20592 : goto __pyx_L8_try_end;
20593 : __pyx_L3_error:;
20594 :
20595 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
20596 : * try:
20597 : * _import_umath()
20598 : * except Exception: # <<<<<<<<<<<<<<
20599 : * raise ImportError("numpy._core.umath failed to import")
20600 : *
20601 : */
20602 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20603 : if (__pyx_t_4) {
20604 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20605 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error)
20606 : __Pyx_XGOTREF(__pyx_t_5);
20607 : __Pyx_XGOTREF(__pyx_t_6);
20608 : __Pyx_XGOTREF(__pyx_t_7);
20609 :
20610 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
20611 : * _import_umath()
20612 : * except Exception:
20613 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20614 : *
20615 : * cdef inline int import_ufunc() except -1:
20616 : */
20617 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error)
20618 : __Pyx_GOTREF(__pyx_t_8);
20619 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20620 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20621 : __PYX_ERR(2, 1031, __pyx_L5_except_error)
20622 : }
20623 : goto __pyx_L5_except_error;
20624 :
20625 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
20626 : *
20627 : * cdef inline int import_umath() except -1:
20628 : * try: # <<<<<<<<<<<<<<
20629 : * _import_umath()
20630 : * except Exception:
20631 : */
20632 : __pyx_L5_except_error:;
20633 : __Pyx_XGIVEREF(__pyx_t_1);
20634 : __Pyx_XGIVEREF(__pyx_t_2);
20635 : __Pyx_XGIVEREF(__pyx_t_3);
20636 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20637 : goto __pyx_L1_error;
20638 : __pyx_L8_try_end:;
20639 : }
20640 :
20641 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
20642 : * raise ImportError("numpy._core.multiarray failed to import")
20643 : *
20644 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
20645 : * try:
20646 : * _import_umath()
20647 : */
20648 :
20649 : /* function exit code */
20650 : __pyx_r = 0;
20651 : goto __pyx_L0;
20652 : __pyx_L1_error:;
20653 : __Pyx_XDECREF(__pyx_t_5);
20654 : __Pyx_XDECREF(__pyx_t_6);
20655 : __Pyx_XDECREF(__pyx_t_7);
20656 : __Pyx_XDECREF(__pyx_t_8);
20657 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
20658 : __pyx_r = -1;
20659 : __pyx_L0:;
20660 : __Pyx_RefNannyFinishContext();
20661 : return __pyx_r;
20662 : }
20663 :
20664 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
20665 : * raise ImportError("numpy._core.umath failed to import")
20666 : *
20667 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20668 : * try:
20669 : * _import_umath()
20670 : */
20671 :
20672 : static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20673 : int __pyx_r;
20674 : __Pyx_RefNannyDeclarations
20675 : PyObject *__pyx_t_1 = NULL;
20676 : PyObject *__pyx_t_2 = NULL;
20677 : PyObject *__pyx_t_3 = NULL;
20678 : int __pyx_t_4;
20679 : PyObject *__pyx_t_5 = NULL;
20680 : PyObject *__pyx_t_6 = NULL;
20681 : PyObject *__pyx_t_7 = NULL;
20682 : PyObject *__pyx_t_8 = NULL;
20683 : int __pyx_lineno = 0;
20684 : const char *__pyx_filename = NULL;
20685 : int __pyx_clineno = 0;
20686 : __Pyx_RefNannySetupContext("import_ufunc", 1);
20687 :
20688 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20689 : *
20690 : * cdef inline int import_ufunc() except -1:
20691 : * try: # <<<<<<<<<<<<<<
20692 : * _import_umath()
20693 : * except Exception:
20694 : */
20695 : {
20696 : __Pyx_PyThreadState_declare
20697 : __Pyx_PyThreadState_assign
20698 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
20699 : __Pyx_XGOTREF(__pyx_t_1);
20700 : __Pyx_XGOTREF(__pyx_t_2);
20701 : __Pyx_XGOTREF(__pyx_t_3);
20702 : /*try:*/ {
20703 :
20704 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
20705 : * cdef inline int import_ufunc() except -1:
20706 : * try:
20707 : * _import_umath() # <<<<<<<<<<<<<<
20708 : * except Exception:
20709 : * raise ImportError("numpy._core.umath failed to import")
20710 : */
20711 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error)
20712 :
20713 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20714 : *
20715 : * cdef inline int import_ufunc() except -1:
20716 : * try: # <<<<<<<<<<<<<<
20717 : * _import_umath()
20718 : * except Exception:
20719 : */
20720 : }
20721 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
20722 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20723 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20724 : goto __pyx_L8_try_end;
20725 : __pyx_L3_error:;
20726 :
20727 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
20728 : * try:
20729 : * _import_umath()
20730 : * except Exception: # <<<<<<<<<<<<<<
20731 : * raise ImportError("numpy._core.umath failed to import")
20732 : *
20733 : */
20734 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
20735 : if (__pyx_t_4) {
20736 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20737 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error)
20738 : __Pyx_XGOTREF(__pyx_t_5);
20739 : __Pyx_XGOTREF(__pyx_t_6);
20740 : __Pyx_XGOTREF(__pyx_t_7);
20741 :
20742 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
20743 : * _import_umath()
20744 : * except Exception:
20745 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
20746 : *
20747 : *
20748 : */
20749 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error)
20750 : __Pyx_GOTREF(__pyx_t_8);
20751 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
20752 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20753 : __PYX_ERR(2, 1037, __pyx_L5_except_error)
20754 : }
20755 : goto __pyx_L5_except_error;
20756 :
20757 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
20758 : *
20759 : * cdef inline int import_ufunc() except -1:
20760 : * try: # <<<<<<<<<<<<<<
20761 : * _import_umath()
20762 : * except Exception:
20763 : */
20764 : __pyx_L5_except_error:;
20765 : __Pyx_XGIVEREF(__pyx_t_1);
20766 : __Pyx_XGIVEREF(__pyx_t_2);
20767 : __Pyx_XGIVEREF(__pyx_t_3);
20768 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
20769 : goto __pyx_L1_error;
20770 : __pyx_L8_try_end:;
20771 : }
20772 :
20773 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
20774 : * raise ImportError("numpy._core.umath failed to import")
20775 : *
20776 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
20777 : * try:
20778 : * _import_umath()
20779 : */
20780 :
20781 : /* function exit code */
20782 : __pyx_r = 0;
20783 : goto __pyx_L0;
20784 : __pyx_L1_error:;
20785 : __Pyx_XDECREF(__pyx_t_5);
20786 : __Pyx_XDECREF(__pyx_t_6);
20787 : __Pyx_XDECREF(__pyx_t_7);
20788 : __Pyx_XDECREF(__pyx_t_8);
20789 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
20790 : __pyx_r = -1;
20791 : __pyx_L0:;
20792 : __Pyx_RefNannyFinishContext();
20793 : return __pyx_r;
20794 : }
20795 :
20796 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
20797 : *
20798 : *
20799 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20800 : * """
20801 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
20802 : */
20803 :
20804 : static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20805 : int __pyx_r;
20806 :
20807 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
20808 : * bool
20809 : * """
20810 : * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
20811 : *
20812 : *
20813 : */
20814 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20815 : goto __pyx_L0;
20816 :
20817 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
20818 : *
20819 : *
20820 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20821 : * """
20822 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
20823 : */
20824 :
20825 : /* function exit code */
20826 : __pyx_L0:;
20827 : return __pyx_r;
20828 : }
20829 :
20830 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
20831 : *
20832 : *
20833 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20834 : * """
20835 : * Cython equivalent of `isinstance(obj, np.datetime64)`
20836 : */
20837 :
20838 : static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20839 : int __pyx_r;
20840 :
20841 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067
20842 : * bool
20843 : * """
20844 : * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
20845 : *
20846 : *
20847 : */
20848 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20849 : goto __pyx_L0;
20850 :
20851 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
20852 : *
20853 : *
20854 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
20855 : * """
20856 : * Cython equivalent of `isinstance(obj, np.datetime64)`
20857 : */
20858 :
20859 : /* function exit code */
20860 : __pyx_L0:;
20861 : return __pyx_r;
20862 : }
20863 :
20864 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
20865 : *
20866 : *
20867 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20868 : * """
20869 : * returns the int64 value underlying scalar numpy datetime64 object
20870 : */
20871 :
20872 : static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20873 : npy_datetime __pyx_r;
20874 :
20875 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077
20876 : * also needed. That can be found using `get_datetime64_unit`.
20877 : * """
20878 : * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
20879 : *
20880 : *
20881 : */
20882 : __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20883 : goto __pyx_L0;
20884 :
20885 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
20886 : *
20887 : *
20888 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20889 : * """
20890 : * returns the int64 value underlying scalar numpy datetime64 object
20891 : */
20892 :
20893 : /* function exit code */
20894 : __pyx_L0:;
20895 : return __pyx_r;
20896 : }
20897 :
20898 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
20899 : *
20900 : *
20901 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20902 : * """
20903 : * returns the int64 value underlying scalar numpy timedelta64 object
20904 : */
20905 :
20906 : static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20907 : npy_timedelta __pyx_r;
20908 :
20909 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084
20910 : * returns the int64 value underlying scalar numpy timedelta64 object
20911 : * """
20912 : * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
20913 : *
20914 : *
20915 : */
20916 : __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20917 : goto __pyx_L0;
20918 :
20919 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
20920 : *
20921 : *
20922 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20923 : * """
20924 : * returns the int64 value underlying scalar numpy timedelta64 object
20925 : */
20926 :
20927 : /* function exit code */
20928 : __pyx_L0:;
20929 : return __pyx_r;
20930 : }
20931 :
20932 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20933 : *
20934 : *
20935 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20936 : * """
20937 : * returns the unit part of the dtype for a numpy datetime64 object.
20938 : */
20939 :
20940 : static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20941 : NPY_DATETIMEUNIT __pyx_r;
20942 :
20943 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091
20944 : * returns the unit part of the dtype for a numpy datetime64 object.
20945 : * """
20946 : * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
20947 : *
20948 : *
20949 : */
20950 : __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20951 : goto __pyx_L0;
20952 :
20953 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20954 : *
20955 : *
20956 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20957 : * """
20958 : * returns the unit part of the dtype for a numpy datetime64 object.
20959 : */
20960 :
20961 : /* function exit code */
20962 : __pyx_L0:;
20963 : return __pyx_r;
20964 : }
20965 :
20966 : /* "scipy/interpolate/_bspl.pyx":62
20967 : * @cython.wraparound(False)
20968 : * @cython.boundscheck(False)
20969 : * cdef inline int find_interval(const double[::1] t, # <<<<<<<<<<<<<<
20970 : * int k,
20971 : * double xval,
20972 : */
20973 :
20974 3449289 : static CYTHON_INLINE int __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__Pyx_memviewslice __pyx_v_t, int __pyx_v_k, double __pyx_v_xval, int __pyx_v_prev_l, int __pyx_v_extrapolate) {
20975 3449289 : int __pyx_r;
20976 3449289 : Py_ssize_t __pyx_t_1;
20977 :
20978 : /* "scipy/interpolate/_bspl.pyx":93
20979 : *
20980 : * """
20981 : * return _find_interval(&t[0], t.shape[0], k, xval, prev_l, extrapolate) # <<<<<<<<<<<<<<
20982 : *
20983 : *
20984 : */
20985 3449289 : __pyx_t_1 = 0;
20986 6898578 : __pyx_r = fitpack::_find_interval((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_1)) )))), (__pyx_v_t.shape[0]), __pyx_v_k, __pyx_v_xval, __pyx_v_prev_l, __pyx_v_extrapolate);
20987 3449289 : goto __pyx_L0;
20988 :
20989 : /* "scipy/interpolate/_bspl.pyx":62
20990 : * @cython.wraparound(False)
20991 : * @cython.boundscheck(False)
20992 : * cdef inline int find_interval(const double[::1] t, # <<<<<<<<<<<<<<
20993 : * int k,
20994 : * double xval,
20995 : */
20996 :
20997 : /* function exit code */
20998 3449289 : __pyx_L0:;
20999 3449289 : return __pyx_r;
21000 : }
21001 :
21002 : /* "scipy/interpolate/_bspl.pyx":98
21003 : * # NB: a python wrapper for find_interval. The leading underscore signals
21004 : * # it's not meant to be user-visible outside of _bsplines.py
21005 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
21006 : * @cython.boundscheck(False)
21007 : * def _py_find_interval(const double[::1] t,
21008 : */
21009 :
21010 : /* Python wrapper */
21011 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_1_py_find_interval(PyObject *__pyx_self,
21012 : #if CYTHON_METH_FASTCALL
21013 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21014 : #else
21015 : PyObject *__pyx_args, PyObject *__pyx_kwds
21016 : #endif
21017 : ); /*proto*/
21018 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_1_py_find_interval = {"_py_find_interval", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_1_py_find_interval, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
21019 110 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_1_py_find_interval(PyObject *__pyx_self,
21020 : #if CYTHON_METH_FASTCALL
21021 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21022 : #else
21023 : PyObject *__pyx_args, PyObject *__pyx_kwds
21024 : #endif
21025 : ) {
21026 110 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
21027 110 : int __pyx_v_k;
21028 110 : double __pyx_v_xval;
21029 110 : int __pyx_v_prev_l;
21030 110 : int __pyx_v_extrapolate;
21031 : #if !CYTHON_METH_FASTCALL
21032 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21033 : #endif
21034 110 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21035 110 : PyObject* values[5] = {0,0,0,0,0};
21036 110 : int __pyx_lineno = 0;
21037 110 : const char *__pyx_filename = NULL;
21038 110 : int __pyx_clineno = 0;
21039 110 : PyObject *__pyx_r = 0;
21040 : __Pyx_RefNannyDeclarations
21041 110 : __Pyx_RefNannySetupContext("_py_find_interval (wrapper)", 0);
21042 : #if !CYTHON_METH_FASTCALL
21043 : #if CYTHON_ASSUME_SAFE_MACROS
21044 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21045 : #else
21046 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21047 : #endif
21048 : #endif
21049 110 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21050 110 : {
21051 110 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_k,&__pyx_n_s_xval,&__pyx_n_s_prev_l,&__pyx_n_s_extrapolate,0};
21052 110 : if (__pyx_kwds) {
21053 55 : Py_ssize_t kw_args;
21054 55 : switch (__pyx_nargs) {
21055 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
21056 55 : CYTHON_FALLTHROUGH;
21057 55 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
21058 55 : CYTHON_FALLTHROUGH;
21059 55 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
21060 55 : CYTHON_FALLTHROUGH;
21061 55 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21062 55 : CYTHON_FALLTHROUGH;
21063 55 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21064 55 : CYTHON_FALLTHROUGH;
21065 55 : case 0: break;
21066 0 : default: goto __pyx_L5_argtuple_error;
21067 : }
21068 55 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
21069 55 : switch (__pyx_nargs) {
21070 0 : case 0:
21071 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
21072 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
21073 0 : kw_args--;
21074 : }
21075 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error)
21076 0 : else goto __pyx_L5_argtuple_error;
21077 0 : CYTHON_FALLTHROUGH;
21078 0 : case 1:
21079 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
21080 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
21081 0 : kw_args--;
21082 : }
21083 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error)
21084 : else {
21085 0 : __Pyx_RaiseArgtupleInvalid("_py_find_interval", 1, 5, 5, 1); __PYX_ERR(0, 98, __pyx_L3_error)
21086 : }
21087 0 : CYTHON_FALLTHROUGH;
21088 0 : case 2:
21089 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xval)) != 0)) {
21090 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
21091 0 : kw_args--;
21092 : }
21093 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error)
21094 : else {
21095 0 : __Pyx_RaiseArgtupleInvalid("_py_find_interval", 1, 5, 5, 2); __PYX_ERR(0, 98, __pyx_L3_error)
21096 : }
21097 0 : CYTHON_FALLTHROUGH;
21098 0 : case 3:
21099 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prev_l)) != 0)) {
21100 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
21101 0 : kw_args--;
21102 : }
21103 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error)
21104 : else {
21105 0 : __Pyx_RaiseArgtupleInvalid("_py_find_interval", 1, 5, 5, 3); __PYX_ERR(0, 98, __pyx_L3_error)
21106 : }
21107 55 : CYTHON_FALLTHROUGH;
21108 55 : case 4:
21109 55 : if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_extrapolate)) != 0)) {
21110 55 : (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
21111 55 : kw_args--;
21112 : }
21113 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L3_error)
21114 : else {
21115 0 : __Pyx_RaiseArgtupleInvalid("_py_find_interval", 1, 5, 5, 4); __PYX_ERR(0, 98, __pyx_L3_error)
21116 : }
21117 : }
21118 55 : if (unlikely(kw_args > 0)) {
21119 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
21120 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_py_find_interval") < 0)) __PYX_ERR(0, 98, __pyx_L3_error)
21121 : }
21122 55 : } else if (unlikely(__pyx_nargs != 5)) {
21123 0 : goto __pyx_L5_argtuple_error;
21124 : } else {
21125 55 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21126 55 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21127 55 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
21128 55 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
21129 55 : values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
21130 : }
21131 110 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 100, __pyx_L3_error)
21132 110 : __pyx_v_k = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error)
21133 110 : __pyx_v_xval = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xval == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L3_error)
21134 110 : __pyx_v_prev_l = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_prev_l == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L3_error)
21135 110 : __pyx_v_extrapolate = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_extrapolate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L3_error)
21136 : }
21137 110 : goto __pyx_L6_skip;
21138 0 : __pyx_L5_argtuple_error:;
21139 0 : __Pyx_RaiseArgtupleInvalid("_py_find_interval", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 98, __pyx_L3_error)
21140 110 : __pyx_L6_skip:;
21141 110 : goto __pyx_L4_argument_unpacking_done;
21142 0 : __pyx_L3_error:;
21143 0 : {
21144 0 : Py_ssize_t __pyx_temp;
21145 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21146 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21147 : }
21148 : }
21149 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
21150 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._py_find_interval", __pyx_clineno, __pyx_lineno, __pyx_filename);
21151 : __Pyx_RefNannyFinishContext();
21152 : return NULL;
21153 110 : __pyx_L4_argument_unpacking_done:;
21154 110 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl__py_find_interval(__pyx_self, __pyx_v_t, __pyx_v_k, __pyx_v_xval, __pyx_v_prev_l, __pyx_v_extrapolate);
21155 :
21156 : /* function exit code */
21157 110 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
21158 : {
21159 : Py_ssize_t __pyx_temp;
21160 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21161 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21162 : }
21163 : }
21164 : __Pyx_RefNannyFinishContext();
21165 : return __pyx_r;
21166 : }
21167 :
21168 110 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl__py_find_interval(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, double __pyx_v_xval, int __pyx_v_prev_l, int __pyx_v_extrapolate) {
21169 110 : PyObject *__pyx_r = NULL;
21170 : __Pyx_RefNannyDeclarations
21171 110 : PyObject *__pyx_t_1 = NULL;
21172 110 : int __pyx_lineno = 0;
21173 110 : const char *__pyx_filename = NULL;
21174 110 : int __pyx_clineno = 0;
21175 110 : __Pyx_RefNannySetupContext("_py_find_interval", 1);
21176 :
21177 : /* "scipy/interpolate/_bspl.pyx":105
21178 : * int prev_l,
21179 : * bint extrapolate):
21180 : * return find_interval(t, k, xval, prev_l, extrapolate) # <<<<<<<<<<<<<<
21181 : *
21182 : *
21183 : */
21184 110 : __Pyx_XDECREF(__pyx_r);
21185 220 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_5scipy_11interpolate_5_bspl_find_interval(__pyx_v_t, __pyx_v_k, __pyx_v_xval, __pyx_v_prev_l, __pyx_v_extrapolate)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
21186 110 : __Pyx_GOTREF(__pyx_t_1);
21187 110 : __pyx_r = __pyx_t_1;
21188 110 : __pyx_t_1 = 0;
21189 110 : goto __pyx_L0;
21190 :
21191 : /* "scipy/interpolate/_bspl.pyx":98
21192 : * # NB: a python wrapper for find_interval. The leading underscore signals
21193 : * # it's not meant to be user-visible outside of _bsplines.py
21194 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
21195 : * @cython.boundscheck(False)
21196 : * def _py_find_interval(const double[::1] t,
21197 : */
21198 :
21199 : /* function exit code */
21200 0 : __pyx_L1_error:;
21201 0 : __Pyx_XDECREF(__pyx_t_1);
21202 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._py_find_interval", __pyx_clineno, __pyx_lineno, __pyx_filename);
21203 0 : __pyx_r = NULL;
21204 110 : __pyx_L0:;
21205 110 : __Pyx_XGIVEREF(__pyx_r);
21206 110 : __Pyx_RefNannyFinishContext();
21207 110 : return __pyx_r;
21208 : }
21209 :
21210 : /* "scipy/interpolate/_bspl.pyx":108
21211 : *
21212 : *
21213 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
21214 : * @cython.boundscheck(False)
21215 : * @cython.cdivision(True)
21216 : */
21217 :
21218 : /* Python wrapper */
21219 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_3evaluate_spline(PyObject *__pyx_self,
21220 : #if CYTHON_METH_FASTCALL
21221 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21222 : #else
21223 : PyObject *__pyx_args, PyObject *__pyx_kwds
21224 : #endif
21225 : ); /*proto*/
21226 : PyDoc_STRVAR(__pyx_doc_5scipy_11interpolate_5_bspl_2evaluate_spline, "\n Evaluate a spline in the B-spline basis.\n\n Parameters\n ----------\n t : ndarray, shape (n+k+1)\n knots\n c : ndarray, shape (n, m)\n B-spline coefficients\n xp : ndarray, shape (s,)\n Points to evaluate the spline at.\n nu : int\n Order of derivative to evaluate.\n extrapolate : int, optional\n Whether to extrapolate to ouf-of-bounds points, or to return NaNs.\n out : ndarray, shape (s, m)\n Computed values of the spline at each of the input points.\n This argument is modified in-place.\n\n ");
21227 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_3evaluate_spline = {"evaluate_spline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_3evaluate_spline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_2evaluate_spline};
21228 10334 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_3evaluate_spline(PyObject *__pyx_self,
21229 : #if CYTHON_METH_FASTCALL
21230 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21231 : #else
21232 : PyObject *__pyx_args, PyObject *__pyx_kwds
21233 : #endif
21234 : ) {
21235 10334 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
21236 10334 : __Pyx_memviewslice __pyx_v_c = { 0, 0, { 0 }, { 0 }, { 0 } };
21237 10334 : int __pyx_v_k;
21238 10334 : __Pyx_memviewslice __pyx_v_xp = { 0, 0, { 0 }, { 0 }, { 0 } };
21239 10334 : int __pyx_v_nu;
21240 10334 : int __pyx_v_extrapolate;
21241 10334 : __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
21242 : #if !CYTHON_METH_FASTCALL
21243 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21244 : #endif
21245 10334 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21246 10334 : PyObject* values[7] = {0,0,0,0,0,0,0};
21247 10334 : int __pyx_lineno = 0;
21248 10334 : const char *__pyx_filename = NULL;
21249 10334 : int __pyx_clineno = 0;
21250 10334 : PyObject *__pyx_r = 0;
21251 : __Pyx_RefNannyDeclarations
21252 10334 : __Pyx_RefNannySetupContext("evaluate_spline (wrapper)", 0);
21253 : #if !CYTHON_METH_FASTCALL
21254 : #if CYTHON_ASSUME_SAFE_MACROS
21255 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21256 : #else
21257 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21258 : #endif
21259 : #endif
21260 10334 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21261 10334 : {
21262 10334 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_c,&__pyx_n_s_k,&__pyx_n_s_xp,&__pyx_n_s_nu,&__pyx_n_s_extrapolate,&__pyx_n_s_out,0};
21263 10334 : if (__pyx_kwds) {
21264 0 : Py_ssize_t kw_args;
21265 0 : switch (__pyx_nargs) {
21266 0 : case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
21267 0 : CYTHON_FALLTHROUGH;
21268 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
21269 0 : CYTHON_FALLTHROUGH;
21270 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
21271 0 : CYTHON_FALLTHROUGH;
21272 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
21273 0 : CYTHON_FALLTHROUGH;
21274 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
21275 0 : CYTHON_FALLTHROUGH;
21276 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21277 0 : CYTHON_FALLTHROUGH;
21278 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21279 0 : CYTHON_FALLTHROUGH;
21280 0 : case 0: break;
21281 0 : default: goto __pyx_L5_argtuple_error;
21282 : }
21283 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
21284 0 : switch (__pyx_nargs) {
21285 0 : case 0:
21286 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
21287 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
21288 0 : kw_args--;
21289 : }
21290 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error)
21291 0 : else goto __pyx_L5_argtuple_error;
21292 0 : CYTHON_FALLTHROUGH;
21293 0 : case 1:
21294 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c)) != 0)) {
21295 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
21296 0 : kw_args--;
21297 : }
21298 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error)
21299 : else {
21300 0 : __Pyx_RaiseArgtupleInvalid("evaluate_spline", 1, 7, 7, 1); __PYX_ERR(0, 108, __pyx_L3_error)
21301 : }
21302 0 : CYTHON_FALLTHROUGH;
21303 0 : case 2:
21304 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
21305 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
21306 0 : kw_args--;
21307 : }
21308 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error)
21309 : else {
21310 0 : __Pyx_RaiseArgtupleInvalid("evaluate_spline", 1, 7, 7, 2); __PYX_ERR(0, 108, __pyx_L3_error)
21311 : }
21312 0 : CYTHON_FALLTHROUGH;
21313 0 : case 3:
21314 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xp)) != 0)) {
21315 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
21316 0 : kw_args--;
21317 : }
21318 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error)
21319 : else {
21320 0 : __Pyx_RaiseArgtupleInvalid("evaluate_spline", 1, 7, 7, 3); __PYX_ERR(0, 108, __pyx_L3_error)
21321 : }
21322 0 : CYTHON_FALLTHROUGH;
21323 0 : case 4:
21324 0 : if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nu)) != 0)) {
21325 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
21326 0 : kw_args--;
21327 : }
21328 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error)
21329 : else {
21330 0 : __Pyx_RaiseArgtupleInvalid("evaluate_spline", 1, 7, 7, 4); __PYX_ERR(0, 108, __pyx_L3_error)
21331 : }
21332 0 : CYTHON_FALLTHROUGH;
21333 0 : case 5:
21334 0 : if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_extrapolate)) != 0)) {
21335 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[5]);
21336 0 : kw_args--;
21337 : }
21338 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error)
21339 : else {
21340 0 : __Pyx_RaiseArgtupleInvalid("evaluate_spline", 1, 7, 7, 5); __PYX_ERR(0, 108, __pyx_L3_error)
21341 : }
21342 0 : CYTHON_FALLTHROUGH;
21343 0 : case 6:
21344 0 : if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out)) != 0)) {
21345 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[6]);
21346 0 : kw_args--;
21347 : }
21348 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 108, __pyx_L3_error)
21349 : else {
21350 0 : __Pyx_RaiseArgtupleInvalid("evaluate_spline", 1, 7, 7, 6); __PYX_ERR(0, 108, __pyx_L3_error)
21351 : }
21352 : }
21353 0 : if (unlikely(kw_args > 0)) {
21354 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
21355 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "evaluate_spline") < 0)) __PYX_ERR(0, 108, __pyx_L3_error)
21356 : }
21357 10334 : } else if (unlikely(__pyx_nargs != 7)) {
21358 0 : goto __pyx_L5_argtuple_error;
21359 : } else {
21360 10334 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21361 10334 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21362 10334 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
21363 10334 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
21364 10334 : values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
21365 10334 : values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
21366 10334 : values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
21367 : }
21368 10334 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 111, __pyx_L3_error)
21369 10334 : __pyx_v_c = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v_c.memview)) __PYX_ERR(0, 112, __pyx_L3_error)
21370 10334 : __pyx_v_k = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L3_error)
21371 10334 : __pyx_v_xp = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[3], 0); if (unlikely(!__pyx_v_xp.memview)) __PYX_ERR(0, 114, __pyx_L3_error)
21372 10334 : __pyx_v_nu = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nu == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L3_error)
21373 10334 : __pyx_v_extrapolate = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_extrapolate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L3_error)
21374 10334 : __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 117, __pyx_L3_error)
21375 : }
21376 10334 : goto __pyx_L6_skip;
21377 0 : __pyx_L5_argtuple_error:;
21378 0 : __Pyx_RaiseArgtupleInvalid("evaluate_spline", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 108, __pyx_L3_error)
21379 10334 : __pyx_L6_skip:;
21380 10334 : goto __pyx_L4_argument_unpacking_done;
21381 0 : __pyx_L3_error:;
21382 0 : {
21383 0 : Py_ssize_t __pyx_temp;
21384 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21385 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21386 : }
21387 : }
21388 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
21389 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_c, 1);
21390 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xp, 1);
21391 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_out, 1);
21392 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.evaluate_spline", __pyx_clineno, __pyx_lineno, __pyx_filename);
21393 : __Pyx_RefNannyFinishContext();
21394 : return NULL;
21395 10334 : __pyx_L4_argument_unpacking_done:;
21396 10334 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_2evaluate_spline(__pyx_self, __pyx_v_t, __pyx_v_c, __pyx_v_k, __pyx_v_xp, __pyx_v_nu, __pyx_v_extrapolate, __pyx_v_out);
21397 :
21398 : /* function exit code */
21399 10334 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
21400 10334 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_c, 1);
21401 10334 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xp, 1);
21402 10334 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_out, 1);
21403 : {
21404 : Py_ssize_t __pyx_temp;
21405 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21406 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21407 : }
21408 : }
21409 : __Pyx_RefNannyFinishContext();
21410 : return __pyx_r;
21411 : }
21412 :
21413 10334 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_2evaluate_spline(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_c, int __pyx_v_k, __Pyx_memviewslice __pyx_v_xp, int __pyx_v_nu, int __pyx_v_extrapolate, __Pyx_memviewslice __pyx_v_out) {
21414 10334 : int __pyx_v_ip;
21415 10334 : int __pyx_v_jp;
21416 10334 : int __pyx_v_a;
21417 10334 : int __pyx_v_interval;
21418 10334 : double __pyx_v_xval;
21419 10334 : __Pyx_memviewslice __pyx_v_work = { 0, 0, { 0 }, { 0 }, { 0 } };
21420 10334 : PyObject *__pyx_r = NULL;
21421 : __Pyx_RefNannyDeclarations
21422 10334 : int __pyx_t_1;
21423 10334 : PyObject *__pyx_t_2 = NULL;
21424 10334 : PyObject *__pyx_t_3 = NULL;
21425 10334 : PyObject *__pyx_t_4 = NULL;
21426 10334 : PyObject *__pyx_t_5 = NULL;
21427 10334 : PyObject *__pyx_t_6 = NULL;
21428 10334 : __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
21429 10334 : Py_ssize_t __pyx_t_8;
21430 10334 : Py_ssize_t __pyx_t_9;
21431 10334 : int __pyx_t_10;
21432 10334 : Py_ssize_t __pyx_t_11;
21433 10334 : Py_ssize_t __pyx_t_12;
21434 10334 : Py_ssize_t __pyx_t_13;
21435 10334 : int __pyx_t_14;
21436 10334 : Py_ssize_t __pyx_t_15;
21437 10334 : long __pyx_t_16;
21438 10334 : long __pyx_t_17;
21439 10334 : int __pyx_t_18;
21440 10334 : Py_ssize_t __pyx_t_19;
21441 10334 : Py_ssize_t __pyx_t_20;
21442 10334 : Py_ssize_t __pyx_t_21;
21443 10334 : Py_ssize_t __pyx_t_22;
21444 10334 : Py_ssize_t __pyx_t_23;
21445 10334 : int __pyx_lineno = 0;
21446 10334 : const char *__pyx_filename = NULL;
21447 10334 : int __pyx_clineno = 0;
21448 10334 : __Pyx_RefNannySetupContext("evaluate_spline", 1);
21449 :
21450 : /* "scipy/interpolate/_bspl.pyx":144
21451 : *
21452 : * # shape checks
21453 : * if out.shape[0] != xp.shape[0]: # <<<<<<<<<<<<<<
21454 : * raise ValueError("out and xp have incompatible shapes")
21455 : * if out.shape[1] != c.shape[1]:
21456 : */
21457 10334 : __pyx_t_1 = ((__pyx_v_out.shape[0]) != (__pyx_v_xp.shape[0]));
21458 10334 : if (unlikely(__pyx_t_1)) {
21459 :
21460 : /* "scipy/interpolate/_bspl.pyx":145
21461 : * # shape checks
21462 : * if out.shape[0] != xp.shape[0]:
21463 : * raise ValueError("out and xp have incompatible shapes") # <<<<<<<<<<<<<<
21464 : * if out.shape[1] != c.shape[1]:
21465 : * raise ValueError("out and c have incompatible shapes")
21466 : */
21467 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
21468 0 : __Pyx_GOTREF(__pyx_t_2);
21469 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21470 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21471 0 : __PYX_ERR(0, 145, __pyx_L1_error)
21472 :
21473 : /* "scipy/interpolate/_bspl.pyx":144
21474 : *
21475 : * # shape checks
21476 : * if out.shape[0] != xp.shape[0]: # <<<<<<<<<<<<<<
21477 : * raise ValueError("out and xp have incompatible shapes")
21478 : * if out.shape[1] != c.shape[1]:
21479 : */
21480 : }
21481 :
21482 : /* "scipy/interpolate/_bspl.pyx":146
21483 : * if out.shape[0] != xp.shape[0]:
21484 : * raise ValueError("out and xp have incompatible shapes")
21485 : * if out.shape[1] != c.shape[1]: # <<<<<<<<<<<<<<
21486 : * raise ValueError("out and c have incompatible shapes")
21487 : *
21488 : */
21489 10334 : __pyx_t_1 = ((__pyx_v_out.shape[1]) != (__pyx_v_c.shape[1]));
21490 10334 : if (unlikely(__pyx_t_1)) {
21491 :
21492 : /* "scipy/interpolate/_bspl.pyx":147
21493 : * raise ValueError("out and xp have incompatible shapes")
21494 : * if out.shape[1] != c.shape[1]:
21495 : * raise ValueError("out and c have incompatible shapes") # <<<<<<<<<<<<<<
21496 : *
21497 : * # check derivative order
21498 : */
21499 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
21500 0 : __Pyx_GOTREF(__pyx_t_2);
21501 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21502 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21503 0 : __PYX_ERR(0, 147, __pyx_L1_error)
21504 :
21505 : /* "scipy/interpolate/_bspl.pyx":146
21506 : * if out.shape[0] != xp.shape[0]:
21507 : * raise ValueError("out and xp have incompatible shapes")
21508 : * if out.shape[1] != c.shape[1]: # <<<<<<<<<<<<<<
21509 : * raise ValueError("out and c have incompatible shapes")
21510 : *
21511 : */
21512 : }
21513 :
21514 : /* "scipy/interpolate/_bspl.pyx":150
21515 : *
21516 : * # check derivative order
21517 : * if nu < 0: # <<<<<<<<<<<<<<
21518 : * raise NotImplementedError("Cannot do derivative order %s." % nu)
21519 : *
21520 : */
21521 10334 : __pyx_t_1 = (__pyx_v_nu < 0);
21522 10334 : if (unlikely(__pyx_t_1)) {
21523 :
21524 : /* "scipy/interpolate/_bspl.pyx":151
21525 : * # check derivative order
21526 : * if nu < 0:
21527 : * raise NotImplementedError("Cannot do derivative order %s." % nu) # <<<<<<<<<<<<<<
21528 : *
21529 : * cdef double[::1] work = np.empty(2*k+2, dtype=np.float64)
21530 : */
21531 0 : __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_nu); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
21532 0 : __Pyx_GOTREF(__pyx_t_2);
21533 0 : __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_Cannot_do_derivative_order_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
21534 0 : __Pyx_GOTREF(__pyx_t_3);
21535 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21536 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
21537 0 : __Pyx_GOTREF(__pyx_t_2);
21538 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21539 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
21540 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21541 0 : __PYX_ERR(0, 151, __pyx_L1_error)
21542 :
21543 : /* "scipy/interpolate/_bspl.pyx":150
21544 : *
21545 : * # check derivative order
21546 : * if nu < 0: # <<<<<<<<<<<<<<
21547 : * raise NotImplementedError("Cannot do derivative order %s." % nu)
21548 : *
21549 : */
21550 : }
21551 :
21552 : /* "scipy/interpolate/_bspl.pyx":153
21553 : * raise NotImplementedError("Cannot do derivative order %s." % nu)
21554 : *
21555 : * cdef double[::1] work = np.empty(2*k+2, dtype=np.float64) # <<<<<<<<<<<<<<
21556 : *
21557 : * # evaluate
21558 : */
21559 10334 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
21560 10334 : __Pyx_GOTREF(__pyx_t_2);
21561 10334 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
21562 10334 : __Pyx_GOTREF(__pyx_t_3);
21563 10334 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21564 10334 : __pyx_t_2 = __Pyx_PyInt_From_long(((2 * __pyx_v_k) + 2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
21565 10334 : __Pyx_GOTREF(__pyx_t_2);
21566 10334 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
21567 10334 : __Pyx_GOTREF(__pyx_t_4);
21568 10334 : __Pyx_GIVEREF(__pyx_t_2);
21569 10334 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error);
21570 10334 : __pyx_t_2 = 0;
21571 10334 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
21572 10334 : __Pyx_GOTREF(__pyx_t_2);
21573 10334 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
21574 10334 : __Pyx_GOTREF(__pyx_t_5);
21575 10334 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
21576 10334 : __Pyx_GOTREF(__pyx_t_6);
21577 10334 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21578 10334 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
21579 10334 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21580 10334 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
21581 10334 : __Pyx_GOTREF(__pyx_t_6);
21582 10334 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21583 10334 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21584 10334 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21585 10334 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 153, __pyx_L1_error)
21586 10334 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21587 10334 : __pyx_v_work = __pyx_t_7;
21588 10334 : __pyx_t_7.memview = NULL;
21589 10334 : __pyx_t_7.data = NULL;
21590 :
21591 : /* "scipy/interpolate/_bspl.pyx":156
21592 : *
21593 : * # evaluate
21594 : * with nogil: # <<<<<<<<<<<<<<
21595 : * interval = k
21596 : * for ip in range(xp.shape[0]):
21597 : */
21598 10334 : {
21599 : #ifdef WITH_THREAD
21600 10334 : PyThreadState *_save;
21601 10334 : _save = NULL;
21602 10334 : Py_UNBLOCK_THREADS
21603 : __Pyx_FastGIL_Remember();
21604 : #endif
21605 : /*try:*/ {
21606 :
21607 : /* "scipy/interpolate/_bspl.pyx":157
21608 : * # evaluate
21609 : * with nogil:
21610 : * interval = k # <<<<<<<<<<<<<<
21611 : * for ip in range(xp.shape[0]):
21612 : * xval = xp[ip]
21613 : */
21614 : __pyx_v_interval = __pyx_v_k;
21615 :
21616 : /* "scipy/interpolate/_bspl.pyx":158
21617 : * with nogil:
21618 : * interval = k
21619 : * for ip in range(xp.shape[0]): # <<<<<<<<<<<<<<
21620 : * xval = xp[ip]
21621 : *
21622 : */
21623 : __pyx_t_8 = (__pyx_v_xp.shape[0]);
21624 : __pyx_t_9 = __pyx_t_8;
21625 147155 : for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
21626 136821 : __pyx_v_ip = __pyx_t_10;
21627 :
21628 : /* "scipy/interpolate/_bspl.pyx":159
21629 : * interval = k
21630 : * for ip in range(xp.shape[0]):
21631 : * xval = xp[ip] # <<<<<<<<<<<<<<
21632 : *
21633 : * # Find correct interval
21634 : */
21635 136821 : __pyx_t_11 = __pyx_v_ip;
21636 136821 : __pyx_v_xval = (*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_xp.data) + __pyx_t_11)) )));
21637 :
21638 : /* "scipy/interpolate/_bspl.pyx":162
21639 : *
21640 : * # Find correct interval
21641 : * interval = find_interval(t, k, xval, interval, extrapolate) # <<<<<<<<<<<<<<
21642 : *
21643 : * if interval < 0:
21644 : */
21645 136821 : __pyx_v_interval = __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__pyx_v_t, __pyx_v_k, __pyx_v_xval, __pyx_v_interval, __pyx_v_extrapolate);
21646 :
21647 : /* "scipy/interpolate/_bspl.pyx":164
21648 : * interval = find_interval(t, k, xval, interval, extrapolate)
21649 : *
21650 : * if interval < 0: # <<<<<<<<<<<<<<
21651 : * # xval was nan etc
21652 : * for jp in range(c.shape[1]):
21653 : */
21654 136821 : __pyx_t_1 = (__pyx_v_interval < 0);
21655 136821 : if (__pyx_t_1) {
21656 :
21657 : /* "scipy/interpolate/_bspl.pyx":166
21658 : * if interval < 0:
21659 : * # xval was nan etc
21660 : * for jp in range(c.shape[1]): # <<<<<<<<<<<<<<
21661 : * out[ip, jp] = NAN
21662 : * continue
21663 : */
21664 : __pyx_t_12 = (__pyx_v_c.shape[1]);
21665 : __pyx_t_13 = __pyx_t_12;
21666 1242 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
21667 621 : __pyx_v_jp = __pyx_t_14;
21668 :
21669 : /* "scipy/interpolate/_bspl.pyx":167
21670 : * # xval was nan etc
21671 : * for jp in range(c.shape[1]):
21672 : * out[ip, jp] = NAN # <<<<<<<<<<<<<<
21673 : * continue
21674 : *
21675 : */
21676 621 : __pyx_t_11 = __pyx_v_ip;
21677 621 : __pyx_t_15 = __pyx_v_jp;
21678 621 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) )) + __pyx_t_15)) )) = NAN;
21679 : }
21680 :
21681 : /* "scipy/interpolate/_bspl.pyx":168
21682 : * for jp in range(c.shape[1]):
21683 : * out[ip, jp] = NAN
21684 : * continue # <<<<<<<<<<<<<<
21685 : *
21686 : * # Evaluate (k+1) b-splines which are non-zero on the interval.
21687 : */
21688 621 : goto __pyx_L9_continue;
21689 :
21690 : /* "scipy/interpolate/_bspl.pyx":164
21691 : * interval = find_interval(t, k, xval, interval, extrapolate)
21692 : *
21693 : * if interval < 0: # <<<<<<<<<<<<<<
21694 : * # xval was nan etc
21695 : * for jp in range(c.shape[1]):
21696 : */
21697 : }
21698 :
21699 : /* "scipy/interpolate/_bspl.pyx":172
21700 : * # Evaluate (k+1) b-splines which are non-zero on the interval.
21701 : * # on return, first k+1 elements of work are B_{m-k},..., B_{m}
21702 : * _deBoor_D(&t[0], xval, k, interval, nu, &work[0]) # <<<<<<<<<<<<<<
21703 : *
21704 : * # Form linear combinations
21705 : */
21706 136200 : __pyx_t_15 = 0;
21707 136200 : __pyx_t_11 = 0;
21708 136200 : fitpack::_deBoor_D((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_15)) )))), __pyx_v_xval, __pyx_v_k, __pyx_v_interval, __pyx_v_nu, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_work.data) + __pyx_t_11)) )))));
21709 :
21710 : /* "scipy/interpolate/_bspl.pyx":175
21711 : *
21712 : * # Form linear combinations
21713 : * for jp in range(c.shape[1]): # <<<<<<<<<<<<<<
21714 : * out[ip, jp] = 0.
21715 : * for a in range(k+1):
21716 : */
21717 : __pyx_t_12 = (__pyx_v_c.shape[1]);
21718 : __pyx_t_13 = __pyx_t_12;
21719 1423897 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
21720 1287697 : __pyx_v_jp = __pyx_t_14;
21721 :
21722 : /* "scipy/interpolate/_bspl.pyx":176
21723 : * # Form linear combinations
21724 : * for jp in range(c.shape[1]):
21725 : * out[ip, jp] = 0. # <<<<<<<<<<<<<<
21726 : * for a in range(k+1):
21727 : * out[ip, jp] = out[ip, jp] + c[interval + a - k, jp] * work[a]
21728 : */
21729 1287697 : __pyx_t_11 = __pyx_v_ip;
21730 1287697 : __pyx_t_15 = __pyx_v_jp;
21731 1287697 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_11 * __pyx_v_out.strides[0]) )) + __pyx_t_15)) )) = 0.;
21732 :
21733 : /* "scipy/interpolate/_bspl.pyx":177
21734 : * for jp in range(c.shape[1]):
21735 : * out[ip, jp] = 0.
21736 : * for a in range(k+1): # <<<<<<<<<<<<<<
21737 : * out[ip, jp] = out[ip, jp] + c[interval + a - k, jp] * work[a]
21738 : *
21739 : */
21740 1287697 : __pyx_t_16 = (__pyx_v_k + 1);
21741 1287697 : __pyx_t_17 = __pyx_t_16;
21742 6409292 : for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
21743 5121595 : __pyx_v_a = __pyx_t_18;
21744 :
21745 : /* "scipy/interpolate/_bspl.pyx":178
21746 : * out[ip, jp] = 0.
21747 : * for a in range(k+1):
21748 : * out[ip, jp] = out[ip, jp] + c[interval + a - k, jp] * work[a] # <<<<<<<<<<<<<<
21749 : *
21750 : *
21751 : */
21752 5121595 : __pyx_t_15 = __pyx_v_ip;
21753 5121595 : __pyx_t_11 = __pyx_v_jp;
21754 5121595 : __pyx_t_19 = ((__pyx_v_interval + __pyx_v_a) - __pyx_v_k);
21755 5121595 : __pyx_t_20 = __pyx_v_jp;
21756 5121595 : __pyx_t_21 = __pyx_v_a;
21757 5121595 : __pyx_t_22 = __pyx_v_ip;
21758 5121595 : __pyx_t_23 = __pyx_v_jp;
21759 5121595 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_22 * __pyx_v_out.strides[0]) )) + __pyx_t_23)) )) = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) )) + __pyx_t_11)) ))) + ((*((double const *) ( /* dim=1 */ ((char *) (((double const *) ( /* dim=0 */ (__pyx_v_c.data + __pyx_t_19 * __pyx_v_c.strides[0]) )) + __pyx_t_20)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_work.data) + __pyx_t_21)) )))));
21760 : }
21761 : }
21762 136821 : __pyx_L9_continue:;
21763 : }
21764 : }
21765 :
21766 : /* "scipy/interpolate/_bspl.pyx":156
21767 : *
21768 : * # evaluate
21769 : * with nogil: # <<<<<<<<<<<<<<
21770 : * interval = k
21771 : * for ip in range(xp.shape[0]):
21772 : */
21773 10334 : /*finally:*/ {
21774 10334 : /*normal exit:*/{
21775 : #ifdef WITH_THREAD
21776 10334 : __Pyx_FastGIL_Forget();
21777 10334 : Py_BLOCK_THREADS
21778 : #endif
21779 10334 : goto __pyx_L8;
21780 : }
21781 10334 : __pyx_L8:;
21782 : }
21783 : }
21784 :
21785 : /* "scipy/interpolate/_bspl.pyx":108
21786 : *
21787 : *
21788 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
21789 : * @cython.boundscheck(False)
21790 : * @cython.cdivision(True)
21791 : */
21792 :
21793 : /* function exit code */
21794 10334 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21795 10334 : goto __pyx_L0;
21796 0 : __pyx_L1_error:;
21797 0 : __Pyx_XDECREF(__pyx_t_2);
21798 0 : __Pyx_XDECREF(__pyx_t_3);
21799 0 : __Pyx_XDECREF(__pyx_t_4);
21800 0 : __Pyx_XDECREF(__pyx_t_5);
21801 0 : __Pyx_XDECREF(__pyx_t_6);
21802 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
21803 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.evaluate_spline", __pyx_clineno, __pyx_lineno, __pyx_filename);
21804 : __pyx_r = NULL;
21805 10334 : __pyx_L0:;
21806 10334 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_work, 1);
21807 10334 : __Pyx_XGIVEREF(__pyx_r);
21808 10334 : __Pyx_RefNannyFinishContext();
21809 10334 : return __pyx_r;
21810 : }
21811 :
21812 : /* "scipy/interpolate/_bspl.pyx":181
21813 : *
21814 : *
21815 : * def evaluate_all_bspl(const double[::1] t, int k, double xval, int m, int nu=0): # <<<<<<<<<<<<<<
21816 : * """Evaluate the ``k+1`` B-splines which are non-zero on interval ``m``.
21817 : *
21818 : */
21819 :
21820 : /* Python wrapper */
21821 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_5evaluate_all_bspl(PyObject *__pyx_self,
21822 : #if CYTHON_METH_FASTCALL
21823 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21824 : #else
21825 : PyObject *__pyx_args, PyObject *__pyx_kwds
21826 : #endif
21827 : ); /*proto*/
21828 : PyDoc_STRVAR(__pyx_doc_5scipy_11interpolate_5_bspl_4evaluate_all_bspl, "Evaluate the ``k+1`` B-splines which are non-zero on interval ``m``.\n\n Parameters\n ----------\n t : ndarray, shape (nt + k + 1,)\n sorted 1D array of knots\n k : int\n spline order\n xval: float\n argument at which to evaluate the B-splines\n m : int\n index of the left edge of the evaluation interval, ``t[m] <= x < t[m+1]``\n nu : int, optional\n Evaluate derivatives order `nu`. Default is zero.\n\n Returns\n -------\n ndarray, shape (k+1,)\n The values of B-splines :math:`[B_{m-k}(xval), ..., B_{m}(xval)]` if\n `nu` is zero, otherwise the derivatives of order `nu`.\n\n Examples\n --------\n\n A textbook use of this sort of routine is plotting the ``k+1`` polynomial\n pieces which make up a B-spline of order `k`.\n\n Consider a cubic spline\n\n >>> k = 3\n >>> t = [0., 1., 2., 3., 4.] # internal knots\n >>> a, b = t[0], t[-1] # base interval is [a, b)\n >>> t = np.array([a]*k + t + [b]*k) # add boundary knots\n\n >>> import matplotlib.pyplot as plt\n >>> xx = np.linspace(a, b, 100)\n >>> plt.plot(xx, BSpline.basis_element(t[k:-k])(xx),\n ... lw=3, alpha=0.5, label='basis_element')\n\n Now we use slide an interval ``t[m]..t[m+1]`` along the base interval\n ``a..b`` and use `evaluate_all_bspl` to compute the restriction of\n the B-spline of interest to this interval:\n\n >>> for i in range(k+1):\n ... x1, x2 = t[2*k - i], t[2*k - i + 1]\n ... xx = np.linspace(x1 - 0.5, x2 + 0.5)\n ... yy = [evaluate_all_bspl(t, k, x, 2*k - i)[i] for x in xx]\n ... plt.plot(xx, yy, '--', label=str(i))\n ...\n >>> plt.grid(True)\n >>> plt.legend()\n >>> plt.show()\n\n ");
21829 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_5evaluate_all_bspl = {"evaluate_all_bspl", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_5evaluate_all_bspl, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_4evaluate_all_bspl};
21830 225 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_5evaluate_all_bspl(PyObject *__pyx_self,
21831 : #if CYTHON_METH_FASTCALL
21832 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21833 : #else
21834 : PyObject *__pyx_args, PyObject *__pyx_kwds
21835 : #endif
21836 : ) {
21837 225 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
21838 225 : int __pyx_v_k;
21839 225 : double __pyx_v_xval;
21840 225 : int __pyx_v_m;
21841 225 : int __pyx_v_nu;
21842 : #if !CYTHON_METH_FASTCALL
21843 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21844 : #endif
21845 225 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21846 225 : PyObject* values[5] = {0,0,0,0,0};
21847 225 : int __pyx_lineno = 0;
21848 225 : const char *__pyx_filename = NULL;
21849 225 : int __pyx_clineno = 0;
21850 225 : PyObject *__pyx_r = 0;
21851 : __Pyx_RefNannyDeclarations
21852 225 : __Pyx_RefNannySetupContext("evaluate_all_bspl (wrapper)", 0);
21853 : #if !CYTHON_METH_FASTCALL
21854 : #if CYTHON_ASSUME_SAFE_MACROS
21855 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21856 : #else
21857 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21858 : #endif
21859 : #endif
21860 225 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21861 225 : {
21862 225 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_k,&__pyx_n_s_xval,&__pyx_n_s_m,&__pyx_n_s_nu,0};
21863 225 : if (__pyx_kwds) {
21864 56 : Py_ssize_t kw_args;
21865 56 : switch (__pyx_nargs) {
21866 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
21867 56 : CYTHON_FALLTHROUGH;
21868 56 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
21869 56 : CYTHON_FALLTHROUGH;
21870 56 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
21871 56 : CYTHON_FALLTHROUGH;
21872 56 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21873 56 : CYTHON_FALLTHROUGH;
21874 56 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21875 56 : CYTHON_FALLTHROUGH;
21876 56 : case 0: break;
21877 0 : default: goto __pyx_L5_argtuple_error;
21878 : }
21879 56 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
21880 56 : switch (__pyx_nargs) {
21881 0 : case 0:
21882 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
21883 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
21884 0 : kw_args--;
21885 : }
21886 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21887 0 : else goto __pyx_L5_argtuple_error;
21888 0 : CYTHON_FALLTHROUGH;
21889 0 : case 1:
21890 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
21891 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
21892 0 : kw_args--;
21893 : }
21894 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21895 : else {
21896 0 : __Pyx_RaiseArgtupleInvalid("evaluate_all_bspl", 0, 4, 5, 1); __PYX_ERR(0, 181, __pyx_L3_error)
21897 : }
21898 0 : CYTHON_FALLTHROUGH;
21899 0 : case 2:
21900 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xval)) != 0)) {
21901 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
21902 0 : kw_args--;
21903 : }
21904 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21905 : else {
21906 0 : __Pyx_RaiseArgtupleInvalid("evaluate_all_bspl", 0, 4, 5, 2); __PYX_ERR(0, 181, __pyx_L3_error)
21907 : }
21908 0 : CYTHON_FALLTHROUGH;
21909 0 : case 3:
21910 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_m)) != 0)) {
21911 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
21912 0 : kw_args--;
21913 : }
21914 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21915 : else {
21916 0 : __Pyx_RaiseArgtupleInvalid("evaluate_all_bspl", 0, 4, 5, 3); __PYX_ERR(0, 181, __pyx_L3_error)
21917 : }
21918 56 : CYTHON_FALLTHROUGH;
21919 56 : case 4:
21920 56 : if (kw_args > 0) {
21921 56 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nu);
21922 56 : if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
21923 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21924 : }
21925 : }
21926 56 : if (unlikely(kw_args > 0)) {
21927 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
21928 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "evaluate_all_bspl") < 0)) __PYX_ERR(0, 181, __pyx_L3_error)
21929 : }
21930 : } else {
21931 169 : switch (__pyx_nargs) {
21932 58 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
21933 169 : CYTHON_FALLTHROUGH;
21934 169 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
21935 169 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
21936 169 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21937 169 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21938 169 : break;
21939 0 : default: goto __pyx_L5_argtuple_error;
21940 : }
21941 : }
21942 225 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 181, __pyx_L3_error)
21943 225 : __pyx_v_k = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21944 225 : __pyx_v_xval = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_xval == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21945 225 : __pyx_v_m = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_m == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21946 225 : if (values[4]) {
21947 114 : __pyx_v_nu = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_nu == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L3_error)
21948 : } else {
21949 : __pyx_v_nu = ((int)((int)0));
21950 : }
21951 : }
21952 225 : goto __pyx_L6_skip;
21953 0 : __pyx_L5_argtuple_error:;
21954 0 : __Pyx_RaiseArgtupleInvalid("evaluate_all_bspl", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 181, __pyx_L3_error)
21955 225 : __pyx_L6_skip:;
21956 225 : goto __pyx_L4_argument_unpacking_done;
21957 0 : __pyx_L3_error:;
21958 0 : {
21959 0 : Py_ssize_t __pyx_temp;
21960 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21961 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21962 : }
21963 : }
21964 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
21965 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.evaluate_all_bspl", __pyx_clineno, __pyx_lineno, __pyx_filename);
21966 : __Pyx_RefNannyFinishContext();
21967 : return NULL;
21968 225 : __pyx_L4_argument_unpacking_done:;
21969 225 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_4evaluate_all_bspl(__pyx_self, __pyx_v_t, __pyx_v_k, __pyx_v_xval, __pyx_v_m, __pyx_v_nu);
21970 :
21971 : /* function exit code */
21972 225 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
21973 : {
21974 : Py_ssize_t __pyx_temp;
21975 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21976 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21977 : }
21978 : }
21979 : __Pyx_RefNannyFinishContext();
21980 : return __pyx_r;
21981 : }
21982 :
21983 225 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_4evaluate_all_bspl(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, double __pyx_v_xval, int __pyx_v_m, int __pyx_v_nu) {
21984 225 : PyObject *__pyx_v_bbb = NULL;
21985 225 : __Pyx_memviewslice __pyx_v_work = { 0, 0, { 0 }, { 0 }, { 0 } };
21986 225 : PyObject *__pyx_r = NULL;
21987 : __Pyx_RefNannyDeclarations
21988 225 : PyObject *__pyx_t_1 = NULL;
21989 225 : PyObject *__pyx_t_2 = NULL;
21990 225 : PyObject *__pyx_t_3 = NULL;
21991 225 : PyObject *__pyx_t_4 = NULL;
21992 225 : PyObject *__pyx_t_5 = NULL;
21993 225 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
21994 225 : Py_ssize_t __pyx_t_7;
21995 225 : int __pyx_t_8;
21996 225 : Py_ssize_t __pyx_t_9;
21997 225 : int __pyx_lineno = 0;
21998 225 : const char *__pyx_filename = NULL;
21999 225 : int __pyx_clineno = 0;
22000 225 : __Pyx_RefNannySetupContext("evaluate_all_bspl", 1);
22001 :
22002 : /* "scipy/interpolate/_bspl.pyx":236
22003 : *
22004 : * """
22005 : * bbb = np.empty(2*k+2, dtype=np.float64) # <<<<<<<<<<<<<<
22006 : * cdef double[::1] work = bbb
22007 : * _deBoor_D(&t[0], xval, k, m, nu, &work[0])
22008 : */
22009 225 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
22010 225 : __Pyx_GOTREF(__pyx_t_1);
22011 225 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
22012 225 : __Pyx_GOTREF(__pyx_t_2);
22013 225 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22014 225 : __pyx_t_1 = __Pyx_PyInt_From_long(((2 * __pyx_v_k) + 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
22015 225 : __Pyx_GOTREF(__pyx_t_1);
22016 225 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
22017 225 : __Pyx_GOTREF(__pyx_t_3);
22018 225 : __Pyx_GIVEREF(__pyx_t_1);
22019 225 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error);
22020 225 : __pyx_t_1 = 0;
22021 225 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
22022 225 : __Pyx_GOTREF(__pyx_t_1);
22023 225 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
22024 225 : __Pyx_GOTREF(__pyx_t_4);
22025 225 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error)
22026 225 : __Pyx_GOTREF(__pyx_t_5);
22027 225 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22028 225 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
22029 225 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22030 225 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error)
22031 225 : __Pyx_GOTREF(__pyx_t_5);
22032 225 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22033 225 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22034 225 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22035 225 : __pyx_v_bbb = __pyx_t_5;
22036 225 : __pyx_t_5 = 0;
22037 :
22038 : /* "scipy/interpolate/_bspl.pyx":237
22039 : * """
22040 : * bbb = np.empty(2*k+2, dtype=np.float64)
22041 : * cdef double[::1] work = bbb # <<<<<<<<<<<<<<
22042 : * _deBoor_D(&t[0], xval, k, m, nu, &work[0])
22043 : * return bbb[:k+1]
22044 : */
22045 225 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_bbb, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 237, __pyx_L1_error)
22046 225 : __pyx_v_work = __pyx_t_6;
22047 225 : __pyx_t_6.memview = NULL;
22048 225 : __pyx_t_6.data = NULL;
22049 :
22050 : /* "scipy/interpolate/_bspl.pyx":238
22051 : * bbb = np.empty(2*k+2, dtype=np.float64)
22052 : * cdef double[::1] work = bbb
22053 : * _deBoor_D(&t[0], xval, k, m, nu, &work[0]) # <<<<<<<<<<<<<<
22054 : * return bbb[:k+1]
22055 : *
22056 : */
22057 225 : __pyx_t_7 = 0;
22058 225 : __pyx_t_8 = -1;
22059 225 : if (__pyx_t_7 < 0) {
22060 : __pyx_t_7 += __pyx_v_t.shape[0];
22061 : if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
22062 225 : } else if (unlikely(__pyx_t_7 >= __pyx_v_t.shape[0])) __pyx_t_8 = 0;
22063 225 : if (unlikely(__pyx_t_8 != -1)) {
22064 0 : __Pyx_RaiseBufferIndexError(__pyx_t_8);
22065 0 : __PYX_ERR(0, 238, __pyx_L1_error)
22066 : }
22067 225 : __pyx_t_9 = 0;
22068 225 : __pyx_t_8 = -1;
22069 225 : if (__pyx_t_9 < 0) {
22070 : __pyx_t_9 += __pyx_v_work.shape[0];
22071 : if (unlikely(__pyx_t_9 < 0)) __pyx_t_8 = 0;
22072 225 : } else if (unlikely(__pyx_t_9 >= __pyx_v_work.shape[0])) __pyx_t_8 = 0;
22073 225 : if (unlikely(__pyx_t_8 != -1)) {
22074 0 : __Pyx_RaiseBufferIndexError(__pyx_t_8);
22075 0 : __PYX_ERR(0, 238, __pyx_L1_error)
22076 : }
22077 225 : fitpack::_deBoor_D((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_7)) )))), __pyx_v_xval, __pyx_v_k, __pyx_v_m, __pyx_v_nu, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_work.data) + __pyx_t_9)) )))));
22078 :
22079 : /* "scipy/interpolate/_bspl.pyx":239
22080 : * cdef double[::1] work = bbb
22081 : * _deBoor_D(&t[0], xval, k, m, nu, &work[0])
22082 : * return bbb[:k+1] # <<<<<<<<<<<<<<
22083 : *
22084 : *
22085 : */
22086 225 : __Pyx_XDECREF(__pyx_r);
22087 225 : __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_bbb, 0, (__pyx_v_k + 1), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error)
22088 225 : __Pyx_GOTREF(__pyx_t_5);
22089 225 : __pyx_r = __pyx_t_5;
22090 225 : __pyx_t_5 = 0;
22091 225 : goto __pyx_L0;
22092 :
22093 : /* "scipy/interpolate/_bspl.pyx":181
22094 : *
22095 : *
22096 : * def evaluate_all_bspl(const double[::1] t, int k, double xval, int m, int nu=0): # <<<<<<<<<<<<<<
22097 : * """Evaluate the ``k+1`` B-splines which are non-zero on interval ``m``.
22098 : *
22099 : */
22100 :
22101 : /* function exit code */
22102 0 : __pyx_L1_error:;
22103 0 : __Pyx_XDECREF(__pyx_t_1);
22104 0 : __Pyx_XDECREF(__pyx_t_2);
22105 0 : __Pyx_XDECREF(__pyx_t_3);
22106 0 : __Pyx_XDECREF(__pyx_t_4);
22107 0 : __Pyx_XDECREF(__pyx_t_5);
22108 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
22109 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.evaluate_all_bspl", __pyx_clineno, __pyx_lineno, __pyx_filename);
22110 : __pyx_r = NULL;
22111 225 : __pyx_L0:;
22112 225 : __Pyx_XDECREF(__pyx_v_bbb);
22113 225 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_work, 1);
22114 225 : __Pyx_XGIVEREF(__pyx_r);
22115 225 : __Pyx_RefNannyFinishContext();
22116 225 : return __pyx_r;
22117 : }
22118 :
22119 : /* "scipy/interpolate/_bspl.pyx":242
22120 : *
22121 : *
22122 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
22123 : * @cython.boundscheck(False)
22124 : * def _colloc(const double[::1] x, const double[::1] t, int k, double[::1, :] ab,
22125 : */
22126 :
22127 : /* Python wrapper */
22128 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_7_colloc(PyObject *__pyx_self,
22129 : #if CYTHON_METH_FASTCALL
22130 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22131 : #else
22132 : PyObject *__pyx_args, PyObject *__pyx_kwds
22133 : #endif
22134 : ); /*proto*/
22135 : PyDoc_STRVAR(__pyx_doc_5scipy_11interpolate_5_bspl_6_colloc, "Build the B-spline collocation matrix.\n\n The collocation matrix is defined as :math:`B_{j,l} = B_l(x_j)`,\n so that row ``j`` contains all the B-splines which are non-zero\n at ``x_j``.\n\n The matrix is constructed in the LAPACK banded storage.\n Basically, for an N-by-N matrix A with ku upper diagonals and\n kl lower diagonals, the shape of the array Ab is (2*kl + ku +1, N),\n where the last kl+ku+1 rows of Ab contain the diagonals of A, and\n the first kl rows of Ab are not referenced.\n For more info see, e.g. the docs for the ``*gbsv`` routine.\n\n This routine is not supposed to be called directly, and\n does no error checking.\n\n Parameters\n ----------\n x : ndarray, shape (n,)\n sorted 1D array of x values\n t : ndarray, shape (nt + k + 1,)\n sorted 1D array of knots\n k : int\n spline order\n ab : ndarray, shape (2*kl + ku + 1, nt), F-order\n This parameter is modified in-place.\n On exit: zeroed out.\n On exit: B-spline collocation matrix in the band storage with\n ``ku`` upper diagonals and ``kl`` lower diagonals.\n Here ``kl = ku = k``.\n offset : int, optional\n skip this many rows\n\n ");
22136 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_7_colloc = {"_colloc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_7_colloc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_6_colloc};
22137 3531 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_7_colloc(PyObject *__pyx_self,
22138 : #if CYTHON_METH_FASTCALL
22139 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22140 : #else
22141 : PyObject *__pyx_args, PyObject *__pyx_kwds
22142 : #endif
22143 : ) {
22144 3531 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
22145 3531 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
22146 3531 : int __pyx_v_k;
22147 3531 : __Pyx_memviewslice __pyx_v_ab = { 0, 0, { 0 }, { 0 }, { 0 } };
22148 3531 : int __pyx_v_offset;
22149 : #if !CYTHON_METH_FASTCALL
22150 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22151 : #endif
22152 3531 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22153 3531 : PyObject* values[5] = {0,0,0,0,0};
22154 3531 : int __pyx_lineno = 0;
22155 3531 : const char *__pyx_filename = NULL;
22156 3531 : int __pyx_clineno = 0;
22157 3531 : PyObject *__pyx_r = 0;
22158 : __Pyx_RefNannyDeclarations
22159 3531 : __Pyx_RefNannySetupContext("_colloc (wrapper)", 0);
22160 : #if !CYTHON_METH_FASTCALL
22161 : #if CYTHON_ASSUME_SAFE_MACROS
22162 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22163 : #else
22164 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22165 : #endif
22166 : #endif
22167 3531 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22168 3531 : {
22169 3531 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_k,&__pyx_n_s_ab,&__pyx_n_s_offset,0};
22170 3531 : if (__pyx_kwds) {
22171 3531 : Py_ssize_t kw_args;
22172 3531 : switch (__pyx_nargs) {
22173 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
22174 3531 : CYTHON_FALLTHROUGH;
22175 3531 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
22176 3531 : CYTHON_FALLTHROUGH;
22177 3531 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
22178 3531 : CYTHON_FALLTHROUGH;
22179 3531 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
22180 3531 : CYTHON_FALLTHROUGH;
22181 3531 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22182 3531 : CYTHON_FALLTHROUGH;
22183 3531 : case 0: break;
22184 0 : default: goto __pyx_L5_argtuple_error;
22185 : }
22186 3531 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
22187 3531 : switch (__pyx_nargs) {
22188 0 : case 0:
22189 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
22190 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
22191 0 : kw_args--;
22192 : }
22193 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
22194 0 : else goto __pyx_L5_argtuple_error;
22195 0 : CYTHON_FALLTHROUGH;
22196 0 : case 1:
22197 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
22198 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
22199 0 : kw_args--;
22200 : }
22201 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
22202 : else {
22203 0 : __Pyx_RaiseArgtupleInvalid("_colloc", 0, 4, 5, 1); __PYX_ERR(0, 242, __pyx_L3_error)
22204 : }
22205 0 : CYTHON_FALLTHROUGH;
22206 0 : case 2:
22207 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
22208 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
22209 0 : kw_args--;
22210 : }
22211 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
22212 : else {
22213 0 : __Pyx_RaiseArgtupleInvalid("_colloc", 0, 4, 5, 2); __PYX_ERR(0, 242, __pyx_L3_error)
22214 : }
22215 0 : CYTHON_FALLTHROUGH;
22216 0 : case 3:
22217 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ab)) != 0)) {
22218 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
22219 0 : kw_args--;
22220 : }
22221 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
22222 : else {
22223 0 : __Pyx_RaiseArgtupleInvalid("_colloc", 0, 4, 5, 3); __PYX_ERR(0, 242, __pyx_L3_error)
22224 : }
22225 3531 : CYTHON_FALLTHROUGH;
22226 3531 : case 4:
22227 3531 : if (kw_args > 0) {
22228 3531 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset);
22229 3531 : if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
22230 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
22231 : }
22232 : }
22233 3531 : if (unlikely(kw_args > 0)) {
22234 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
22235 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_colloc") < 0)) __PYX_ERR(0, 242, __pyx_L3_error)
22236 : }
22237 : } else {
22238 0 : switch (__pyx_nargs) {
22239 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
22240 0 : CYTHON_FALLTHROUGH;
22241 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
22242 0 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
22243 0 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
22244 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22245 0 : break;
22246 0 : default: goto __pyx_L5_argtuple_error;
22247 : }
22248 : }
22249 3531 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 244, __pyx_L3_error)
22250 3531 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 244, __pyx_L3_error)
22251 3531 : __pyx_v_k = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 244, __pyx_L3_error)
22252 3531 : __pyx_v_ab = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_ab.memview)) __PYX_ERR(0, 244, __pyx_L3_error)
22253 3531 : if (values[4]) {
22254 3531 : __pyx_v_offset = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_offset == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L3_error)
22255 : } else {
22256 : __pyx_v_offset = ((int)((int)0));
22257 : }
22258 : }
22259 3531 : goto __pyx_L6_skip;
22260 0 : __pyx_L5_argtuple_error:;
22261 0 : __Pyx_RaiseArgtupleInvalid("_colloc", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 242, __pyx_L3_error)
22262 3531 : __pyx_L6_skip:;
22263 3531 : goto __pyx_L4_argument_unpacking_done;
22264 0 : __pyx_L3_error:;
22265 0 : {
22266 0 : Py_ssize_t __pyx_temp;
22267 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22268 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22269 : }
22270 : }
22271 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
22272 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
22273 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_ab, 1);
22274 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._colloc", __pyx_clineno, __pyx_lineno, __pyx_filename);
22275 : __Pyx_RefNannyFinishContext();
22276 : return NULL;
22277 3531 : __pyx_L4_argument_unpacking_done:;
22278 3531 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_6_colloc(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_k, __pyx_v_ab, __pyx_v_offset);
22279 :
22280 : /* function exit code */
22281 3531 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
22282 3531 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
22283 3531 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_ab, 1);
22284 : {
22285 : Py_ssize_t __pyx_temp;
22286 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22287 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22288 : }
22289 : }
22290 : __Pyx_RefNannyFinishContext();
22291 : return __pyx_r;
22292 : }
22293 :
22294 3531 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_6_colloc(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, __Pyx_memviewslice __pyx_v_ab, int __pyx_v_offset) {
22295 3531 : int __pyx_v_left;
22296 3531 : int __pyx_v_j;
22297 3531 : int __pyx_v_a;
22298 3531 : int __pyx_v_kl;
22299 3531 : int __pyx_v_ku;
22300 3531 : int __pyx_v_clmn;
22301 3531 : double __pyx_v_xval;
22302 3531 : __Pyx_memviewslice __pyx_v_wrk = { 0, 0, { 0 }, { 0 }, { 0 } };
22303 3531 : PyObject *__pyx_r = NULL;
22304 : __Pyx_RefNannyDeclarations
22305 3531 : PyObject *__pyx_t_1 = NULL;
22306 3531 : PyObject *__pyx_t_2 = NULL;
22307 3531 : PyObject *__pyx_t_3 = NULL;
22308 3531 : PyObject *__pyx_t_4 = NULL;
22309 3531 : PyObject *__pyx_t_5 = NULL;
22310 3531 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
22311 3531 : Py_ssize_t __pyx_t_7;
22312 3531 : Py_ssize_t __pyx_t_8;
22313 3531 : int __pyx_t_9;
22314 3531 : Py_ssize_t __pyx_t_10;
22315 3531 : Py_ssize_t __pyx_t_11;
22316 3531 : long __pyx_t_12;
22317 3531 : long __pyx_t_13;
22318 3531 : int __pyx_t_14;
22319 3531 : Py_ssize_t __pyx_t_15;
22320 3531 : int __pyx_lineno = 0;
22321 3531 : const char *__pyx_filename = NULL;
22322 3531 : int __pyx_clineno = 0;
22323 3531 : __Pyx_RefNannySetupContext("_colloc", 1);
22324 :
22325 : /* "scipy/interpolate/_bspl.pyx":283
22326 : * cdef double xval
22327 : *
22328 : * kl = ku = k # <<<<<<<<<<<<<<
22329 : * cdef double[::1] wrk = np.empty(2*k + 2, dtype=np.float64)
22330 : *
22331 : */
22332 3531 : __pyx_v_kl = __pyx_v_k;
22333 3531 : __pyx_v_ku = __pyx_v_k;
22334 :
22335 : /* "scipy/interpolate/_bspl.pyx":284
22336 : *
22337 : * kl = ku = k
22338 : * cdef double[::1] wrk = np.empty(2*k + 2, dtype=np.float64) # <<<<<<<<<<<<<<
22339 : *
22340 : * # collocation matrix
22341 : */
22342 3531 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
22343 3531 : __Pyx_GOTREF(__pyx_t_1);
22344 3531 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
22345 3531 : __Pyx_GOTREF(__pyx_t_2);
22346 3531 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22347 3531 : __pyx_t_1 = __Pyx_PyInt_From_long(((2 * __pyx_v_k) + 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
22348 3531 : __Pyx_GOTREF(__pyx_t_1);
22349 3531 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
22350 3531 : __Pyx_GOTREF(__pyx_t_3);
22351 3531 : __Pyx_GIVEREF(__pyx_t_1);
22352 3531 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error);
22353 3531 : __pyx_t_1 = 0;
22354 3531 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
22355 3531 : __Pyx_GOTREF(__pyx_t_1);
22356 3531 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
22357 3531 : __Pyx_GOTREF(__pyx_t_4);
22358 3531 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
22359 3531 : __Pyx_GOTREF(__pyx_t_5);
22360 3531 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22361 3531 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
22362 3531 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22363 3531 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
22364 3531 : __Pyx_GOTREF(__pyx_t_5);
22365 3531 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22366 3531 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22367 3531 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22368 3531 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 284, __pyx_L1_error)
22369 3531 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22370 3531 : __pyx_v_wrk = __pyx_t_6;
22371 3531 : __pyx_t_6.memview = NULL;
22372 3531 : __pyx_t_6.data = NULL;
22373 :
22374 : /* "scipy/interpolate/_bspl.pyx":287
22375 : *
22376 : * # collocation matrix
22377 : * with nogil: # <<<<<<<<<<<<<<
22378 : * left = k
22379 : * for j in range(x.shape[0]):
22380 : */
22381 3531 : {
22382 : #ifdef WITH_THREAD
22383 3531 : PyThreadState *_save;
22384 3531 : _save = NULL;
22385 3531 : Py_UNBLOCK_THREADS
22386 3531 : __Pyx_FastGIL_Remember();
22387 : #endif
22388 3531 : /*try:*/ {
22389 :
22390 : /* "scipy/interpolate/_bspl.pyx":288
22391 : * # collocation matrix
22392 : * with nogil:
22393 : * left = k # <<<<<<<<<<<<<<
22394 : * for j in range(x.shape[0]):
22395 : * xval = x[j]
22396 : */
22397 3531 : __pyx_v_left = __pyx_v_k;
22398 :
22399 : /* "scipy/interpolate/_bspl.pyx":289
22400 : * with nogil:
22401 : * left = k
22402 : * for j in range(x.shape[0]): # <<<<<<<<<<<<<<
22403 : * xval = x[j]
22404 : * # find interval
22405 : */
22406 3531 : __pyx_t_7 = (__pyx_v_x.shape[0]);
22407 3531 : __pyx_t_8 = __pyx_t_7;
22408 28598 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
22409 25067 : __pyx_v_j = __pyx_t_9;
22410 :
22411 : /* "scipy/interpolate/_bspl.pyx":290
22412 : * left = k
22413 : * for j in range(x.shape[0]):
22414 : * xval = x[j] # <<<<<<<<<<<<<<
22415 : * # find interval
22416 : * left = find_interval(t, k, xval, left, extrapolate=False)
22417 : */
22418 25067 : __pyx_t_10 = __pyx_v_j;
22419 25067 : __pyx_v_xval = (*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_x.data) + __pyx_t_10)) )));
22420 :
22421 : /* "scipy/interpolate/_bspl.pyx":292
22422 : * xval = x[j]
22423 : * # find interval
22424 : * left = find_interval(t, k, xval, left, extrapolate=False) # <<<<<<<<<<<<<<
22425 : *
22426 : * # fill a row
22427 : */
22428 25067 : __pyx_v_left = __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__pyx_v_t, __pyx_v_k, __pyx_v_xval, __pyx_v_left, 0);
22429 :
22430 : /* "scipy/interpolate/_bspl.pyx":295
22431 : *
22432 : * # fill a row
22433 : * _deBoor_D(&t[0], xval, k, left, 0, &wrk[0]) # <<<<<<<<<<<<<<
22434 : * # for a full matrix it would be ``A[j + offset, left-k:left+1] = bb``
22435 : * # in the banded storage, need to spread the row over
22436 : */
22437 25067 : __pyx_t_10 = 0;
22438 25067 : __pyx_t_11 = 0;
22439 25067 : fitpack::_deBoor_D((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_10)) )))), __pyx_v_xval, __pyx_v_k, __pyx_v_left, 0, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_11)) )))));
22440 :
22441 : /* "scipy/interpolate/_bspl.pyx":298
22442 : * # for a full matrix it would be ``A[j + offset, left-k:left+1] = bb``
22443 : * # in the banded storage, need to spread the row over
22444 : * for a in range(k+1): # <<<<<<<<<<<<<<
22445 : * clmn = left - k + a
22446 : * ab[kl + ku + j + offset - clmn, clmn] = wrk[a]
22447 : */
22448 143761 : __pyx_t_12 = (__pyx_v_k + 1);
22449 : __pyx_t_13 = __pyx_t_12;
22450 143761 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
22451 118694 : __pyx_v_a = __pyx_t_14;
22452 :
22453 : /* "scipy/interpolate/_bspl.pyx":299
22454 : * # in the banded storage, need to spread the row over
22455 : * for a in range(k+1):
22456 : * clmn = left - k + a # <<<<<<<<<<<<<<
22457 : * ab[kl + ku + j + offset - clmn, clmn] = wrk[a]
22458 : *
22459 : */
22460 118694 : __pyx_v_clmn = ((__pyx_v_left - __pyx_v_k) + __pyx_v_a);
22461 :
22462 : /* "scipy/interpolate/_bspl.pyx":300
22463 : * for a in range(k+1):
22464 : * clmn = left - k + a
22465 : * ab[kl + ku + j + offset - clmn, clmn] = wrk[a] # <<<<<<<<<<<<<<
22466 : *
22467 : *
22468 : */
22469 118694 : __pyx_t_11 = __pyx_v_a;
22470 118694 : __pyx_t_10 = ((((__pyx_v_kl + __pyx_v_ku) + __pyx_v_j) + __pyx_v_offset) - __pyx_v_clmn);
22471 118694 : __pyx_t_15 = __pyx_v_clmn;
22472 118694 : *((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_ab.data) + __pyx_t_10)) ) + __pyx_t_15 * __pyx_v_ab.strides[1]) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_11)) )));
22473 : }
22474 : }
22475 : }
22476 :
22477 : /* "scipy/interpolate/_bspl.pyx":287
22478 : *
22479 : * # collocation matrix
22480 : * with nogil: # <<<<<<<<<<<<<<
22481 : * left = k
22482 : * for j in range(x.shape[0]):
22483 : */
22484 3531 : /*finally:*/ {
22485 3531 : /*normal exit:*/{
22486 : #ifdef WITH_THREAD
22487 3531 : __Pyx_FastGIL_Forget();
22488 3531 : Py_BLOCK_THREADS
22489 : #endif
22490 3531 : goto __pyx_L5;
22491 : }
22492 3531 : __pyx_L5:;
22493 : }
22494 : }
22495 :
22496 : /* "scipy/interpolate/_bspl.pyx":242
22497 : *
22498 : *
22499 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
22500 : * @cython.boundscheck(False)
22501 : * def _colloc(const double[::1] x, const double[::1] t, int k, double[::1, :] ab,
22502 : */
22503 :
22504 : /* function exit code */
22505 3531 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22506 3531 : goto __pyx_L0;
22507 0 : __pyx_L1_error:;
22508 0 : __Pyx_XDECREF(__pyx_t_1);
22509 0 : __Pyx_XDECREF(__pyx_t_2);
22510 0 : __Pyx_XDECREF(__pyx_t_3);
22511 0 : __Pyx_XDECREF(__pyx_t_4);
22512 0 : __Pyx_XDECREF(__pyx_t_5);
22513 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
22514 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._colloc", __pyx_clineno, __pyx_lineno, __pyx_filename);
22515 : __pyx_r = NULL;
22516 3531 : __pyx_L0:;
22517 3531 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_wrk, 1);
22518 3531 : __Pyx_XGIVEREF(__pyx_r);
22519 3531 : __Pyx_RefNannyFinishContext();
22520 3531 : return __pyx_r;
22521 : }
22522 :
22523 : /* "scipy/interpolate/_bspl.pyx":303
22524 : *
22525 : *
22526 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
22527 : * @cython.boundscheck(False)
22528 : * def _norm_eq_lsq(const double[::1] x,
22529 : */
22530 :
22531 : /* Python wrapper */
22532 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_9_norm_eq_lsq(PyObject *__pyx_self,
22533 : #if CYTHON_METH_FASTCALL
22534 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22535 : #else
22536 : PyObject *__pyx_args, PyObject *__pyx_kwds
22537 : #endif
22538 : ); /*proto*/
22539 : PyDoc_STRVAR(__pyx_doc_5scipy_11interpolate_5_bspl_8_norm_eq_lsq, "Construct the normal equations for the B-spline LSQ problem.\n\n The observation equations are ``A @ c = y``, and the normal equations are\n ``A.T @ A @ c = A.T @ y``. This routine fills in the rhs and lhs for the\n latter.\n\n The B-spline collocation matrix is defined as :math:`A_{j,l} = B_l(x_j)`,\n so that row ``j`` contains all the B-splines which are non-zero\n at ``x_j``.\n\n The normal eq matrix has at most `2k+1` bands and is constructed in the\n LAPACK symmetrix banded storage: ``A[i, j] == ab[i-j, j]`` with `i >= j`.\n See the doctsring for `scipy.linalg.cholesky_banded` for more info.\n\n This routine is not supposed to be called directly, and\n does no error checking.\n\n Parameters\n ----------\n x : ndarray, shape (n,)\n sorted 1D array of x values\n t : ndarray, shape (nt + k + 1,)\n sorted 1D array of knots\n k : int\n spline order\n y : ndarray, shape (n, s)\n a 2D array of y values. The second dimension contains all trailing\n dimensions of the original array of ordinates.\n w : ndarray, shape(n,)\n Weights.\n ab : ndarray, shape (k+1, n), in Fortran order.\n This parameter is modified in-place.\n On entry: should be zeroed out.\n On exit: LHS of the normal equations.\n rhs : ndarray, shape (n, s), in C order.\n This parameter is modified in-place.\n On entry: should be zeroed out.\n On exit: RHS of the normal equations.\n\n ");
22540 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_9_norm_eq_lsq = {"_norm_eq_lsq", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_9_norm_eq_lsq, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_8_norm_eq_lsq};
22541 24 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_9_norm_eq_lsq(PyObject *__pyx_self,
22542 : #if CYTHON_METH_FASTCALL
22543 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22544 : #else
22545 : PyObject *__pyx_args, PyObject *__pyx_kwds
22546 : #endif
22547 : ) {
22548 24 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
22549 24 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
22550 24 : int __pyx_v_k;
22551 24 : __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
22552 24 : __Pyx_memviewslice __pyx_v_w = { 0, 0, { 0 }, { 0 }, { 0 } };
22553 24 : __Pyx_memviewslice __pyx_v_ab = { 0, 0, { 0 }, { 0 }, { 0 } };
22554 24 : __Pyx_memviewslice __pyx_v_rhs = { 0, 0, { 0 }, { 0 }, { 0 } };
22555 : #if !CYTHON_METH_FASTCALL
22556 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22557 : #endif
22558 24 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22559 24 : PyObject* values[7] = {0,0,0,0,0,0,0};
22560 24 : int __pyx_lineno = 0;
22561 24 : const char *__pyx_filename = NULL;
22562 24 : int __pyx_clineno = 0;
22563 24 : PyObject *__pyx_r = 0;
22564 : __Pyx_RefNannyDeclarations
22565 24 : __Pyx_RefNannySetupContext("_norm_eq_lsq (wrapper)", 0);
22566 : #if !CYTHON_METH_FASTCALL
22567 : #if CYTHON_ASSUME_SAFE_MACROS
22568 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22569 : #else
22570 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22571 : #endif
22572 : #endif
22573 24 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22574 24 : {
22575 24 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_k,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_ab,&__pyx_n_s_rhs,0};
22576 24 : if (__pyx_kwds) {
22577 0 : Py_ssize_t kw_args;
22578 0 : switch (__pyx_nargs) {
22579 0 : case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
22580 0 : CYTHON_FALLTHROUGH;
22581 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
22582 0 : CYTHON_FALLTHROUGH;
22583 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
22584 0 : CYTHON_FALLTHROUGH;
22585 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
22586 0 : CYTHON_FALLTHROUGH;
22587 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
22588 0 : CYTHON_FALLTHROUGH;
22589 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
22590 0 : CYTHON_FALLTHROUGH;
22591 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22592 0 : CYTHON_FALLTHROUGH;
22593 0 : case 0: break;
22594 0 : default: goto __pyx_L5_argtuple_error;
22595 : }
22596 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
22597 0 : switch (__pyx_nargs) {
22598 0 : case 0:
22599 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
22600 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
22601 0 : kw_args--;
22602 : }
22603 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
22604 0 : else goto __pyx_L5_argtuple_error;
22605 0 : CYTHON_FALLTHROUGH;
22606 0 : case 1:
22607 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
22608 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
22609 0 : kw_args--;
22610 : }
22611 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
22612 : else {
22613 0 : __Pyx_RaiseArgtupleInvalid("_norm_eq_lsq", 1, 7, 7, 1); __PYX_ERR(0, 303, __pyx_L3_error)
22614 : }
22615 0 : CYTHON_FALLTHROUGH;
22616 0 : case 2:
22617 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
22618 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
22619 0 : kw_args--;
22620 : }
22621 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
22622 : else {
22623 0 : __Pyx_RaiseArgtupleInvalid("_norm_eq_lsq", 1, 7, 7, 2); __PYX_ERR(0, 303, __pyx_L3_error)
22624 : }
22625 0 : CYTHON_FALLTHROUGH;
22626 0 : case 3:
22627 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) {
22628 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
22629 0 : kw_args--;
22630 : }
22631 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
22632 : else {
22633 0 : __Pyx_RaiseArgtupleInvalid("_norm_eq_lsq", 1, 7, 7, 3); __PYX_ERR(0, 303, __pyx_L3_error)
22634 : }
22635 0 : CYTHON_FALLTHROUGH;
22636 0 : case 4:
22637 0 : if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w)) != 0)) {
22638 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
22639 0 : kw_args--;
22640 : }
22641 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
22642 : else {
22643 0 : __Pyx_RaiseArgtupleInvalid("_norm_eq_lsq", 1, 7, 7, 4); __PYX_ERR(0, 303, __pyx_L3_error)
22644 : }
22645 0 : CYTHON_FALLTHROUGH;
22646 0 : case 5:
22647 0 : if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ab)) != 0)) {
22648 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[5]);
22649 0 : kw_args--;
22650 : }
22651 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
22652 : else {
22653 0 : __Pyx_RaiseArgtupleInvalid("_norm_eq_lsq", 1, 7, 7, 5); __PYX_ERR(0, 303, __pyx_L3_error)
22654 : }
22655 0 : CYTHON_FALLTHROUGH;
22656 0 : case 6:
22657 0 : if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rhs)) != 0)) {
22658 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[6]);
22659 0 : kw_args--;
22660 : }
22661 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
22662 : else {
22663 0 : __Pyx_RaiseArgtupleInvalid("_norm_eq_lsq", 1, 7, 7, 6); __PYX_ERR(0, 303, __pyx_L3_error)
22664 : }
22665 : }
22666 0 : if (unlikely(kw_args > 0)) {
22667 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
22668 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_norm_eq_lsq") < 0)) __PYX_ERR(0, 303, __pyx_L3_error)
22669 : }
22670 24 : } else if (unlikely(__pyx_nargs != 7)) {
22671 0 : goto __pyx_L5_argtuple_error;
22672 : } else {
22673 24 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22674 24 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
22675 24 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
22676 24 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
22677 24 : values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
22678 24 : values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
22679 24 : values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
22680 : }
22681 24 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 305, __pyx_L3_error)
22682 24 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 306, __pyx_L3_error)
22683 24 : __pyx_v_k = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error)
22684 24 : __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(values[3], 0); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 308, __pyx_L3_error)
22685 24 : __pyx_v_w = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[4], 0); if (unlikely(!__pyx_v_w.memview)) __PYX_ERR(0, 309, __pyx_L3_error)
22686 24 : __pyx_v_ab = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(values[5], PyBUF_WRITABLE); if (unlikely(!__pyx_v_ab.memview)) __PYX_ERR(0, 310, __pyx_L3_error)
22687 24 : __pyx_v_rhs = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[6], PyBUF_WRITABLE); if (unlikely(!__pyx_v_rhs.memview)) __PYX_ERR(0, 311, __pyx_L3_error)
22688 : }
22689 24 : goto __pyx_L6_skip;
22690 0 : __pyx_L5_argtuple_error:;
22691 0 : __Pyx_RaiseArgtupleInvalid("_norm_eq_lsq", 1, 7, 7, __pyx_nargs); __PYX_ERR(0, 303, __pyx_L3_error)
22692 24 : __pyx_L6_skip:;
22693 24 : goto __pyx_L4_argument_unpacking_done;
22694 0 : __pyx_L3_error:;
22695 0 : {
22696 0 : Py_ssize_t __pyx_temp;
22697 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22698 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22699 : }
22700 : }
22701 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
22702 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
22703 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
22704 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_w, 1);
22705 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_ab, 1);
22706 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_rhs, 1);
22707 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._norm_eq_lsq", __pyx_clineno, __pyx_lineno, __pyx_filename);
22708 : __Pyx_RefNannyFinishContext();
22709 : return NULL;
22710 24 : __pyx_L4_argument_unpacking_done:;
22711 24 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_8_norm_eq_lsq(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_k, __pyx_v_y, __pyx_v_w, __pyx_v_ab, __pyx_v_rhs);
22712 :
22713 : /* function exit code */
22714 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
22715 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
22716 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
22717 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_w, 1);
22718 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_ab, 1);
22719 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_rhs, 1);
22720 : {
22721 : Py_ssize_t __pyx_temp;
22722 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22723 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22724 : }
22725 : }
22726 : __Pyx_RefNannyFinishContext();
22727 : return __pyx_r;
22728 : }
22729 :
22730 24 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_8_norm_eq_lsq(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, __Pyx_memviewslice __pyx_v_y, __Pyx_memviewslice __pyx_v_w, __Pyx_memviewslice __pyx_v_ab, __Pyx_memviewslice __pyx_v_rhs) {
22731 24 : int __pyx_v_j;
22732 24 : int __pyx_v_r;
22733 24 : int __pyx_v_s;
22734 24 : int __pyx_v_row;
22735 24 : int __pyx_v_clmn;
22736 24 : int __pyx_v_left;
22737 24 : int __pyx_v_ci;
22738 24 : double __pyx_v_xval;
22739 24 : double __pyx_v_wval;
22740 24 : __Pyx_memviewslice __pyx_v_wrk = { 0, 0, { 0 }, { 0 }, { 0 } };
22741 24 : PyObject *__pyx_r = NULL;
22742 : __Pyx_RefNannyDeclarations
22743 24 : PyObject *__pyx_t_1 = NULL;
22744 24 : PyObject *__pyx_t_2 = NULL;
22745 24 : PyObject *__pyx_t_3 = NULL;
22746 24 : PyObject *__pyx_t_4 = NULL;
22747 24 : PyObject *__pyx_t_5 = NULL;
22748 24 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
22749 24 : Py_ssize_t __pyx_t_7;
22750 24 : Py_ssize_t __pyx_t_8;
22751 24 : int __pyx_t_9;
22752 24 : Py_ssize_t __pyx_t_10;
22753 24 : Py_ssize_t __pyx_t_11;
22754 24 : long __pyx_t_12;
22755 24 : long __pyx_t_13;
22756 24 : int __pyx_t_14;
22757 24 : long __pyx_t_15;
22758 24 : long __pyx_t_16;
22759 24 : int __pyx_t_17;
22760 24 : Py_ssize_t __pyx_t_18;
22761 24 : Py_ssize_t __pyx_t_19;
22762 24 : Py_ssize_t __pyx_t_20;
22763 24 : Py_ssize_t __pyx_t_21;
22764 24 : Py_ssize_t __pyx_t_22;
22765 24 : Py_ssize_t __pyx_t_23;
22766 24 : Py_ssize_t __pyx_t_24;
22767 24 : int __pyx_lineno = 0;
22768 24 : const char *__pyx_filename = NULL;
22769 24 : int __pyx_clineno = 0;
22770 24 : __Pyx_RefNannySetupContext("_norm_eq_lsq", 1);
22771 :
22772 : /* "scipy/interpolate/_bspl.pyx":355
22773 : * int j, r, s, row, clmn, left, ci
22774 : * double xval, wval
22775 : * double[::1] wrk = np.empty(2*k + 2, dtype=np.float64) # <<<<<<<<<<<<<<
22776 : *
22777 : * with nogil:
22778 : */
22779 24 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
22780 24 : __Pyx_GOTREF(__pyx_t_1);
22781 24 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
22782 24 : __Pyx_GOTREF(__pyx_t_2);
22783 24 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22784 24 : __pyx_t_1 = __Pyx_PyInt_From_long(((2 * __pyx_v_k) + 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
22785 24 : __Pyx_GOTREF(__pyx_t_1);
22786 24 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
22787 24 : __Pyx_GOTREF(__pyx_t_3);
22788 24 : __Pyx_GIVEREF(__pyx_t_1);
22789 24 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error);
22790 24 : __pyx_t_1 = 0;
22791 24 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
22792 24 : __Pyx_GOTREF(__pyx_t_1);
22793 24 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error)
22794 24 : __Pyx_GOTREF(__pyx_t_4);
22795 24 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error)
22796 24 : __Pyx_GOTREF(__pyx_t_5);
22797 24 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22798 24 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 355, __pyx_L1_error)
22799 24 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22800 24 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error)
22801 24 : __Pyx_GOTREF(__pyx_t_5);
22802 24 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22803 24 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22804 24 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22805 24 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 355, __pyx_L1_error)
22806 24 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22807 24 : __pyx_v_wrk = __pyx_t_6;
22808 24 : __pyx_t_6.memview = NULL;
22809 24 : __pyx_t_6.data = NULL;
22810 :
22811 : /* "scipy/interpolate/_bspl.pyx":357
22812 : * double[::1] wrk = np.empty(2*k + 2, dtype=np.float64)
22813 : *
22814 : * with nogil: # <<<<<<<<<<<<<<
22815 : * left = k
22816 : * for j in range(x.shape[0]):
22817 : */
22818 24 : {
22819 : #ifdef WITH_THREAD
22820 24 : PyThreadState *_save;
22821 24 : _save = NULL;
22822 24 : Py_UNBLOCK_THREADS
22823 24 : __Pyx_FastGIL_Remember();
22824 : #endif
22825 24 : /*try:*/ {
22826 :
22827 : /* "scipy/interpolate/_bspl.pyx":358
22828 : *
22829 : * with nogil:
22830 : * left = k # <<<<<<<<<<<<<<
22831 : * for j in range(x.shape[0]):
22832 : * xval = x[j]
22833 : */
22834 24 : __pyx_v_left = __pyx_v_k;
22835 :
22836 : /* "scipy/interpolate/_bspl.pyx":359
22837 : * with nogil:
22838 : * left = k
22839 : * for j in range(x.shape[0]): # <<<<<<<<<<<<<<
22840 : * xval = x[j]
22841 : * wval = w[j] * w[j]
22842 : */
22843 24 : __pyx_t_7 = (__pyx_v_x.shape[0]);
22844 24 : __pyx_t_8 = __pyx_t_7;
22845 348 : for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
22846 324 : __pyx_v_j = __pyx_t_9;
22847 :
22848 : /* "scipy/interpolate/_bspl.pyx":360
22849 : * left = k
22850 : * for j in range(x.shape[0]):
22851 : * xval = x[j] # <<<<<<<<<<<<<<
22852 : * wval = w[j] * w[j]
22853 : * # find interval
22854 : */
22855 324 : __pyx_t_10 = __pyx_v_j;
22856 324 : __pyx_v_xval = (*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_x.data) + __pyx_t_10)) )));
22857 :
22858 : /* "scipy/interpolate/_bspl.pyx":361
22859 : * for j in range(x.shape[0]):
22860 : * xval = x[j]
22861 : * wval = w[j] * w[j] # <<<<<<<<<<<<<<
22862 : * # find interval
22863 : * left = find_interval(t, k, xval, left, extrapolate=False)
22864 : */
22865 324 : __pyx_t_10 = __pyx_v_j;
22866 324 : __pyx_t_11 = __pyx_v_j;
22867 324 : __pyx_v_wval = ((*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_w.data) + __pyx_t_10)) ))) * (*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_w.data) + __pyx_t_11)) ))));
22868 :
22869 : /* "scipy/interpolate/_bspl.pyx":363
22870 : * wval = w[j] * w[j]
22871 : * # find interval
22872 : * left = find_interval(t, k, xval, left, extrapolate=False) # <<<<<<<<<<<<<<
22873 : *
22874 : * # non-zero B-splines at xval
22875 : */
22876 324 : __pyx_v_left = __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__pyx_v_t, __pyx_v_k, __pyx_v_xval, __pyx_v_left, 0);
22877 :
22878 : /* "scipy/interpolate/_bspl.pyx":366
22879 : *
22880 : * # non-zero B-splines at xval
22881 : * _deBoor_D(&t[0], xval, k, left, 0, &wrk[0]) # <<<<<<<<<<<<<<
22882 : *
22883 : * # non-zero values of A.T @ A: banded storage w/ lower=True
22884 : */
22885 324 : __pyx_t_11 = 0;
22886 324 : __pyx_t_10 = 0;
22887 324 : fitpack::_deBoor_D((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_11)) )))), __pyx_v_xval, __pyx_v_k, __pyx_v_left, 0, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_10)) )))));
22888 :
22889 : /* "scipy/interpolate/_bspl.pyx":373
22890 : * # Here we work out A.T @ A *in the banded storage* w/lower=True
22891 : * # see the docstring of `scipy.linalg.cholesky_banded`.
22892 : * for r in range(k+1): # <<<<<<<<<<<<<<
22893 : * row = left - k + r
22894 : * for s in range(r+1):
22895 : */
22896 1531 : __pyx_t_12 = (__pyx_v_k + 1);
22897 : __pyx_t_13 = __pyx_t_12;
22898 1531 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
22899 1207 : __pyx_v_r = __pyx_t_14;
22900 :
22901 : /* "scipy/interpolate/_bspl.pyx":374
22902 : * # see the docstring of `scipy.linalg.cholesky_banded`.
22903 : * for r in range(k+1):
22904 : * row = left - k + r # <<<<<<<<<<<<<<
22905 : * for s in range(r+1):
22906 : * clmn = left - k + s
22907 : */
22908 1207 : __pyx_v_row = ((__pyx_v_left - __pyx_v_k) + __pyx_v_r);
22909 :
22910 : /* "scipy/interpolate/_bspl.pyx":375
22911 : * for r in range(k+1):
22912 : * row = left - k + r
22913 : * for s in range(r+1): # <<<<<<<<<<<<<<
22914 : * clmn = left - k + s
22915 : * ab[r-s, clmn] += wrk[r] * wrk[s] * wval
22916 : */
22917 1207 : __pyx_t_15 = (__pyx_v_r + 1);
22918 1207 : __pyx_t_16 = __pyx_t_15;
22919 4298 : for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
22920 3091 : __pyx_v_s = __pyx_t_17;
22921 :
22922 : /* "scipy/interpolate/_bspl.pyx":376
22923 : * row = left - k + r
22924 : * for s in range(r+1):
22925 : * clmn = left - k + s # <<<<<<<<<<<<<<
22926 : * ab[r-s, clmn] += wrk[r] * wrk[s] * wval
22927 : *
22928 : */
22929 3091 : __pyx_v_clmn = ((__pyx_v_left - __pyx_v_k) + __pyx_v_s);
22930 :
22931 : /* "scipy/interpolate/_bspl.pyx":377
22932 : * for s in range(r+1):
22933 : * clmn = left - k + s
22934 : * ab[r-s, clmn] += wrk[r] * wrk[s] * wval # <<<<<<<<<<<<<<
22935 : *
22936 : * # ... and A.T @ y
22937 : */
22938 3091 : __pyx_t_10 = __pyx_v_r;
22939 3091 : __pyx_t_11 = __pyx_v_s;
22940 3091 : __pyx_t_18 = (__pyx_v_r - __pyx_v_s);
22941 3091 : __pyx_t_19 = __pyx_v_clmn;
22942 3091 : *((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_ab.data) + __pyx_t_18)) ) + __pyx_t_19 * __pyx_v_ab.strides[1]) )) += (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_10)) ))) * (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_11)) )))) * __pyx_v_wval);
22943 : }
22944 :
22945 : /* "scipy/interpolate/_bspl.pyx":380
22946 : *
22947 : * # ... and A.T @ y
22948 : * for ci in range(rhs.shape[1]): # <<<<<<<<<<<<<<
22949 : * rhs[row, ci] = rhs[row, ci] + wrk[r] * y[j, ci] * wval
22950 : *
22951 : */
22952 1207 : __pyx_t_20 = (__pyx_v_rhs.shape[1]);
22953 1207 : __pyx_t_21 = __pyx_t_20;
22954 13542 : for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_21; __pyx_t_17+=1) {
22955 12335 : __pyx_v_ci = __pyx_t_17;
22956 :
22957 : /* "scipy/interpolate/_bspl.pyx":381
22958 : * # ... and A.T @ y
22959 : * for ci in range(rhs.shape[1]):
22960 : * rhs[row, ci] = rhs[row, ci] + wrk[r] * y[j, ci] * wval # <<<<<<<<<<<<<<
22961 : *
22962 : * @cython.wraparound(False)
22963 : */
22964 12335 : __pyx_t_11 = __pyx_v_row;
22965 12335 : __pyx_t_10 = __pyx_v_ci;
22966 12335 : __pyx_t_19 = __pyx_v_r;
22967 12335 : __pyx_t_18 = __pyx_v_j;
22968 12335 : __pyx_t_22 = __pyx_v_ci;
22969 12335 : __pyx_t_23 = __pyx_v_row;
22970 12335 : __pyx_t_24 = __pyx_v_ci;
22971 12335 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_rhs.data + __pyx_t_23 * __pyx_v_rhs.strides[0]) )) + __pyx_t_24)) )) = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_rhs.data + __pyx_t_11 * __pyx_v_rhs.strides[0]) )) + __pyx_t_10)) ))) + (((*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_19)) ))) * (*((double const *) ( /* dim=1 */ ((char *) (((double const *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_18 * __pyx_v_y.strides[0]) )) + __pyx_t_22)) )))) * __pyx_v_wval));
22972 : }
22973 : }
22974 : }
22975 : }
22976 :
22977 : /* "scipy/interpolate/_bspl.pyx":357
22978 : * double[::1] wrk = np.empty(2*k + 2, dtype=np.float64)
22979 : *
22980 : * with nogil: # <<<<<<<<<<<<<<
22981 : * left = k
22982 : * for j in range(x.shape[0]):
22983 : */
22984 24 : /*finally:*/ {
22985 24 : /*normal exit:*/{
22986 : #ifdef WITH_THREAD
22987 24 : __Pyx_FastGIL_Forget();
22988 24 : Py_BLOCK_THREADS
22989 : #endif
22990 24 : goto __pyx_L5;
22991 : }
22992 24 : __pyx_L5:;
22993 : }
22994 : }
22995 :
22996 : /* "scipy/interpolate/_bspl.pyx":303
22997 : *
22998 : *
22999 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
23000 : * @cython.boundscheck(False)
23001 : * def _norm_eq_lsq(const double[::1] x,
23002 : */
23003 :
23004 : /* function exit code */
23005 24 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23006 24 : goto __pyx_L0;
23007 0 : __pyx_L1_error:;
23008 0 : __Pyx_XDECREF(__pyx_t_1);
23009 0 : __Pyx_XDECREF(__pyx_t_2);
23010 0 : __Pyx_XDECREF(__pyx_t_3);
23011 0 : __Pyx_XDECREF(__pyx_t_4);
23012 0 : __Pyx_XDECREF(__pyx_t_5);
23013 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
23014 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._norm_eq_lsq", __pyx_clineno, __pyx_lineno, __pyx_filename);
23015 : __pyx_r = NULL;
23016 24 : __pyx_L0:;
23017 24 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_wrk, 1);
23018 24 : __Pyx_XGIVEREF(__pyx_r);
23019 24 : __Pyx_RefNannyFinishContext();
23020 24 : return __pyx_r;
23021 : }
23022 :
23023 : /* "scipy/interpolate/_bspl.pyx":383
23024 : * rhs[row, ci] = rhs[row, ci] + wrk[r] * y[j, ci] * wval
23025 : *
23026 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
23027 : * @cython.boundscheck(False)
23028 : * def _make_design_matrix(const double[::1] x,
23029 : */
23030 :
23031 : /* Python wrapper */
23032 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_11_make_design_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23033 : PyDoc_STRVAR(__pyx_doc_5scipy_11interpolate_5_bspl_10_make_design_matrix, "\n Returns a design matrix in CSR format.\n\n Note that only indices is passed, but not indptr because indptr is already\n precomputed in the calling Python function design_matrix.\n\n Parameters\n ----------\n x : array_like, shape (n,)\n Points to evaluate the spline at.\n t : array_like, shape (nt,)\n Sorted 1D array of knots.\n k : int\n B-spline degree.\n extrapolate : bool, optional\n Whether to extrapolate to ouf-of-bounds points.\n indices : ndarray, shape (n * (k + 1),)\n Preallocated indices of the final CSR array.\n\n Returns\n -------\n data\n The data array of a CSR array of the b-spline design matrix.\n In each row all the basis elements are evaluated at the certain point\n (first row - x[0], ..., last row - x[-1]).\n\n indices\n The indices array of a CSR array of the b-spline design matrix.\n ");
23034 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_11_make_design_matrix = {"_make_design_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_11_make_design_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_10_make_design_matrix};
23035 55 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_11_make_design_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23036 55 : PyObject *__pyx_v_signatures = 0;
23037 55 : PyObject *__pyx_v_args = 0;
23038 55 : PyObject *__pyx_v_kwargs = 0;
23039 55 : CYTHON_UNUSED PyObject *__pyx_v_defaults = 0;
23040 55 : PyObject *__pyx_v__fused_sigindex = 0;
23041 55 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23042 55 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23043 55 : PyObject* values[5] = {0,0,0,0,0};
23044 55 : int __pyx_lineno = 0;
23045 55 : const char *__pyx_filename = NULL;
23046 55 : int __pyx_clineno = 0;
23047 55 : PyObject *__pyx_r = 0;
23048 : __Pyx_RefNannyDeclarations
23049 55 : __Pyx_RefNannySetupContext("__pyx_fused_cpdef (wrapper)", 0);
23050 : #if CYTHON_ASSUME_SAFE_MACROS
23051 55 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
23052 : #else
23053 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
23054 : #endif
23055 55 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
23056 55 : {
23057 55 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signatures,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_defaults,&__pyx_n_s_fused_sigindex,0};
23058 55 : __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
23059 55 : values[4] = __Pyx_Arg_NewRef_VARARGS(__pyx_dynamic_args->__pyx_arg__fused_sigindex);
23060 55 : if (__pyx_kwds) {
23061 0 : Py_ssize_t kw_args;
23062 0 : switch (__pyx_nargs) {
23063 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
23064 0 : CYTHON_FALLTHROUGH;
23065 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
23066 0 : CYTHON_FALLTHROUGH;
23067 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
23068 0 : CYTHON_FALLTHROUGH;
23069 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
23070 0 : CYTHON_FALLTHROUGH;
23071 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
23072 0 : CYTHON_FALLTHROUGH;
23073 0 : case 0: break;
23074 0 : default: goto __pyx_L5_argtuple_error;
23075 : }
23076 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
23077 0 : switch (__pyx_nargs) {
23078 0 : case 0:
23079 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_signatures)) != 0)) {
23080 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
23081 0 : kw_args--;
23082 : }
23083 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
23084 0 : else goto __pyx_L5_argtuple_error;
23085 0 : CYTHON_FALLTHROUGH;
23086 0 : case 1:
23087 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_args)) != 0)) {
23088 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
23089 0 : kw_args--;
23090 : }
23091 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
23092 : else {
23093 0 : __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 0, 4, 5, 1); __PYX_ERR(0, 383, __pyx_L3_error)
23094 : }
23095 0 : CYTHON_FALLTHROUGH;
23096 0 : case 2:
23097 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_kwargs)) != 0)) {
23098 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
23099 0 : kw_args--;
23100 : }
23101 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
23102 : else {
23103 0 : __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 0, 4, 5, 2); __PYX_ERR(0, 383, __pyx_L3_error)
23104 : }
23105 0 : CYTHON_FALLTHROUGH;
23106 0 : case 3:
23107 0 : if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_defaults)) != 0)) {
23108 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[3]);
23109 0 : kw_args--;
23110 : }
23111 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
23112 : else {
23113 0 : __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 0, 4, 5, 3); __PYX_ERR(0, 383, __pyx_L3_error)
23114 : }
23115 0 : CYTHON_FALLTHROUGH;
23116 0 : case 4:
23117 0 : if (kw_args > 0) {
23118 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_fused_sigindex);
23119 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
23120 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
23121 : }
23122 : }
23123 0 : if (unlikely(kw_args > 0)) {
23124 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
23125 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 383, __pyx_L3_error)
23126 : }
23127 : } else {
23128 55 : switch (__pyx_nargs) {
23129 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
23130 55 : CYTHON_FALLTHROUGH;
23131 55 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
23132 55 : values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
23133 55 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
23134 55 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
23135 55 : break;
23136 0 : default: goto __pyx_L5_argtuple_error;
23137 : }
23138 : }
23139 55 : __pyx_v_signatures = values[0];
23140 55 : __pyx_v_args = values[1];
23141 55 : __pyx_v_kwargs = values[2];
23142 55 : __pyx_v_defaults = values[3];
23143 55 : __pyx_v__fused_sigindex = values[4];
23144 : }
23145 55 : goto __pyx_L6_skip;
23146 0 : __pyx_L5_argtuple_error:;
23147 0 : __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 383, __pyx_L3_error)
23148 55 : __pyx_L6_skip:;
23149 55 : goto __pyx_L4_argument_unpacking_done;
23150 0 : __pyx_L3_error:;
23151 0 : {
23152 0 : Py_ssize_t __pyx_temp;
23153 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23154 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
23155 : }
23156 : }
23157 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
23158 : __Pyx_RefNannyFinishContext();
23159 : return NULL;
23160 55 : __pyx_L4_argument_unpacking_done:;
23161 55 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_10_make_design_matrix(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults, __pyx_v__fused_sigindex);
23162 :
23163 : /* function exit code */
23164 : {
23165 : Py_ssize_t __pyx_temp;
23166 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
23167 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
23168 : }
23169 : }
23170 : __Pyx_RefNannyFinishContext();
23171 : return __pyx_r;
23172 : }
23173 :
23174 55 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_10_make_design_matrix(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults, PyObject *__pyx_v__fused_sigindex) {
23175 55 : PyObject *__pyx_v_search_list = 0;
23176 55 : PyObject *__pyx_v_sigindex_node = 0;
23177 55 : PyObject *__pyx_v_dest_sig = NULL;
23178 55 : PyTypeObject *__pyx_v_ndarray = 0;
23179 55 : PyObject *__pyx_v_arg_as_memoryview = 0;
23180 55 : __Pyx_memviewslice __pyx_v_memslice;
23181 55 : Py_ssize_t __pyx_v_itemsize;
23182 55 : int __pyx_v_dtype_signed;
23183 55 : Py_UCS4 __pyx_v_kind;
23184 55 : int __pyx_v___pyx_fused_dtype_npy__int32_is_signed;
23185 55 : int __pyx_v___pyx_fused_dtype_npy__int64_is_signed;
23186 55 : PyObject *__pyx_v_arg = NULL;
23187 55 : PyObject *__pyx_v_dtype = NULL;
23188 55 : PyObject *__pyx_v_arg_base = NULL;
23189 55 : PyObject *__pyx_v_sig = NULL;
23190 55 : PyObject *__pyx_v_sig_series = NULL;
23191 55 : PyObject *__pyx_v_last_type = NULL;
23192 55 : PyObject *__pyx_v_sig_type = NULL;
23193 55 : PyObject *__pyx_v_sigindex_matches = NULL;
23194 55 : PyObject *__pyx_v_sigindex_candidates = NULL;
23195 55 : PyObject *__pyx_v_dst_type = NULL;
23196 55 : PyObject *__pyx_v_found_matches = NULL;
23197 55 : PyObject *__pyx_v_found_candidates = NULL;
23198 55 : PyObject *__pyx_v_sn = NULL;
23199 55 : PyObject *__pyx_v_type_match = NULL;
23200 55 : PyObject *__pyx_v_candidates = NULL;
23201 55 : PyObject *__pyx_r = NULL;
23202 : __Pyx_RefNannyDeclarations
23203 55 : PyObject *__pyx_t_1 = NULL;
23204 55 : int __pyx_t_2;
23205 55 : int __pyx_t_3;
23206 55 : int __pyx_t_4;
23207 55 : Py_ssize_t __pyx_t_5;
23208 55 : PyObject *__pyx_t_6 = NULL;
23209 55 : long __pyx_t_7;
23210 55 : PyObject *__pyx_t_8 = NULL;
23211 55 : PyObject *__pyx_t_9 = NULL;
23212 55 : PyObject *__pyx_t_10 = NULL;
23213 55 : int __pyx_t_11;
23214 55 : __Pyx_memviewslice __pyx_t_12;
23215 55 : PyObject *__pyx_t_13 = NULL;
23216 55 : Py_ssize_t __pyx_t_14;
23217 55 : int __pyx_t_15;
23218 55 : PyObject *__pyx_t_16 = NULL;
23219 55 : PyObject *__pyx_t_17 = NULL;
23220 55 : unsigned int __pyx_t_18;
23221 55 : Py_ssize_t __pyx_t_19;
23222 55 : int __pyx_t_20;
23223 55 : int __pyx_lineno = 0;
23224 55 : const char *__pyx_filename = NULL;
23225 55 : int __pyx_clineno = 0;
23226 55 : __Pyx_RefNannySetupContext("_make_design_matrix", 0);
23227 55 : __Pyx_INCREF(__pyx_v_kwargs);
23228 55 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23229 55 : __Pyx_GOTREF(__pyx_t_1);
23230 55 : __Pyx_INCREF(Py_None);
23231 55 : __Pyx_GIVEREF(Py_None);
23232 55 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_None)) __PYX_ERR(0, 383, __pyx_L1_error);
23233 55 : __pyx_v_dest_sig = ((PyObject*)__pyx_t_1);
23234 55 : __pyx_t_1 = 0;
23235 55 : __pyx_t_3 = (__pyx_v_kwargs != Py_None);
23236 55 : if (__pyx_t_3) {
23237 : } else {
23238 55 : __pyx_t_2 = __pyx_t_3;
23239 55 : goto __pyx_L4_bool_binop_done;
23240 : }
23241 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23242 0 : __pyx_t_4 = (!__pyx_t_3);
23243 0 : __pyx_t_2 = __pyx_t_4;
23244 55 : __pyx_L4_bool_binop_done:;
23245 55 : if (__pyx_t_2) {
23246 0 : __Pyx_INCREF(Py_None);
23247 0 : __Pyx_DECREF_SET(__pyx_v_kwargs, Py_None);
23248 : }
23249 55 : __pyx_t_1 = ((PyObject *)__Pyx_ImportNumPyArrayTypeIfAvailable()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23250 55 : __Pyx_GOTREF(__pyx_t_1);
23251 55 : __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
23252 55 : __pyx_t_1 = 0;
23253 55 : __pyx_v_itemsize = -1L;
23254 55 : __pyx_v___pyx_fused_dtype_npy__int32_is_signed = (!(((npy_int32)-1L) > 0));
23255 55 : __pyx_v___pyx_fused_dtype_npy__int64_is_signed = (!(((npy_int64)-1L) > 0));
23256 55 : if (unlikely(__pyx_v_args == Py_None)) {
23257 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
23258 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23259 : }
23260 55 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 383, __pyx_L1_error)
23261 55 : __pyx_t_2 = (4 < __pyx_t_5);
23262 55 : if (__pyx_t_2) {
23263 55 : if (unlikely(__pyx_v_args == Py_None)) {
23264 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
23265 : __PYX_ERR(0, 383, __pyx_L1_error)
23266 : }
23267 55 : __pyx_t_1 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 4);
23268 55 : __Pyx_INCREF(__pyx_t_1);
23269 55 : __pyx_v_arg = __pyx_t_1;
23270 55 : __pyx_t_1 = 0;
23271 55 : goto __pyx_L6;
23272 : }
23273 0 : __pyx_t_4 = (__pyx_v_kwargs != Py_None);
23274 0 : if (__pyx_t_4) {
23275 : } else {
23276 0 : __pyx_t_2 = __pyx_t_4;
23277 0 : goto __pyx_L7_bool_binop_done;
23278 : }
23279 0 : if (unlikely(__pyx_v_kwargs == Py_None)) {
23280 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
23281 : __PYX_ERR(0, 383, __pyx_L1_error)
23282 : }
23283 0 : __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_indices, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23284 : __pyx_t_2 = __pyx_t_4;
23285 0 : __pyx_L7_bool_binop_done:;
23286 0 : if (likely(__pyx_t_2)) {
23287 0 : if (unlikely(__pyx_v_kwargs == Py_None)) {
23288 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
23289 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23290 : }
23291 0 : __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23292 0 : __Pyx_GOTREF(__pyx_t_1);
23293 0 : __pyx_v_arg = __pyx_t_1;
23294 0 : __pyx_t_1 = 0;
23295 0 : goto __pyx_L6;
23296 : }
23297 0 : /*else*/ {
23298 0 : if (unlikely(__pyx_v_args == Py_None)) {
23299 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
23300 : __PYX_ERR(0, 383, __pyx_L1_error)
23301 : }
23302 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 383, __pyx_L1_error)
23303 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23304 0 : __Pyx_GOTREF(__pyx_t_1);
23305 0 : __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23306 0 : __Pyx_GOTREF(__pyx_t_6);
23307 0 : __Pyx_INCREF(__pyx_int_5);
23308 0 : __Pyx_GIVEREF(__pyx_int_5);
23309 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_5)) __PYX_ERR(0, 383, __pyx_L1_error);
23310 0 : __Pyx_INCREF(__pyx_n_s_s);
23311 0 : __Pyx_GIVEREF(__pyx_n_s_s);
23312 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_s)) __PYX_ERR(0, 383, __pyx_L1_error);
23313 0 : __Pyx_GIVEREF(__pyx_t_1);
23314 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error);
23315 0 : __pyx_t_1 = 0;
23316 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23317 0 : __Pyx_GOTREF(__pyx_t_1);
23318 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23319 0 : __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23320 0 : __Pyx_GOTREF(__pyx_t_6);
23321 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23322 0 : __Pyx_Raise(__pyx_t_6, 0, 0, 0);
23323 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23324 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23325 : }
23326 55 : __pyx_L6:;
23327 55 : while (1) {
23328 55 : __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)Py_None));
23329 55 : if (__pyx_t_2) {
23330 55 : __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
23331 55 : if (__pyx_t_2) {
23332 55 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23333 55 : __Pyx_GOTREF(__pyx_t_6);
23334 55 : __pyx_v_dtype = __pyx_t_6;
23335 55 : __pyx_t_6 = 0;
23336 55 : goto __pyx_L12;
23337 : }
23338 0 : __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
23339 0 : if (__pyx_t_2) {
23340 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23341 0 : __Pyx_GOTREF(__pyx_t_6);
23342 0 : __pyx_v_arg_base = __pyx_t_6;
23343 0 : __pyx_t_6 = 0;
23344 0 : __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
23345 0 : if (__pyx_t_2) {
23346 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23347 0 : __Pyx_GOTREF(__pyx_t_6);
23348 0 : __pyx_v_dtype = __pyx_t_6;
23349 0 : __pyx_t_6 = 0;
23350 0 : goto __pyx_L13;
23351 : }
23352 0 : /*else*/ {
23353 0 : __Pyx_INCREF(Py_None);
23354 : __pyx_v_dtype = Py_None;
23355 : }
23356 0 : __pyx_L13:;
23357 0 : goto __pyx_L12;
23358 : }
23359 0 : /*else*/ {
23360 0 : __Pyx_INCREF(Py_None);
23361 : __pyx_v_dtype = Py_None;
23362 : }
23363 55 : __pyx_L12:;
23364 55 : __pyx_v_itemsize = -1L;
23365 55 : __pyx_t_2 = (__pyx_v_dtype != Py_None);
23366 55 : if (__pyx_t_2) {
23367 55 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23368 55 : __Pyx_GOTREF(__pyx_t_6);
23369 55 : __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error)
23370 55 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23371 55 : __pyx_v_itemsize = __pyx_t_5;
23372 55 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23373 55 : __Pyx_GOTREF(__pyx_t_6);
23374 55 : __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_t_6); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 383, __pyx_L1_error)
23375 55 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23376 55 : __pyx_v_kind = __pyx_t_7;
23377 55 : __pyx_v_dtype_signed = (__pyx_v_kind == 0x69);
23378 55 : switch (__pyx_v_kind) {
23379 55 : case 0x69:
23380 55 : case 0x75:
23381 55 : __pyx_t_4 = ((sizeof(npy_int32)) == __pyx_v_itemsize);
23382 55 : if (__pyx_t_4) {
23383 : } else {
23384 0 : __pyx_t_2 = __pyx_t_4;
23385 0 : goto __pyx_L16_bool_binop_done;
23386 : }
23387 55 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23388 55 : __Pyx_GOTREF(__pyx_t_6);
23389 55 : __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error)
23390 55 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23391 55 : __pyx_t_4 = (((Py_ssize_t)__pyx_t_5) == 1);
23392 55 : if (__pyx_t_4) {
23393 : } else {
23394 0 : __pyx_t_2 = __pyx_t_4;
23395 0 : goto __pyx_L16_bool_binop_done;
23396 : }
23397 55 : __pyx_t_4 = (!(__pyx_v___pyx_fused_dtype_npy__int32_is_signed ^ __pyx_v_dtype_signed));
23398 55 : __pyx_t_2 = __pyx_t_4;
23399 55 : __pyx_L16_bool_binop_done:;
23400 55 : if (__pyx_t_2) {
23401 55 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_npy_int32, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23402 55 : goto __pyx_L10_break;
23403 : }
23404 0 : __pyx_t_4 = ((sizeof(npy_int64)) == __pyx_v_itemsize);
23405 0 : if (__pyx_t_4) {
23406 : } else {
23407 0 : __pyx_t_2 = __pyx_t_4;
23408 0 : goto __pyx_L20_bool_binop_done;
23409 : }
23410 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23411 0 : __Pyx_GOTREF(__pyx_t_6);
23412 0 : __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L1_error)
23413 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23414 0 : __pyx_t_4 = (((Py_ssize_t)__pyx_t_5) == 1);
23415 0 : if (__pyx_t_4) {
23416 : } else {
23417 0 : __pyx_t_2 = __pyx_t_4;
23418 0 : goto __pyx_L20_bool_binop_done;
23419 : }
23420 0 : __pyx_t_4 = (!(__pyx_v___pyx_fused_dtype_npy__int64_is_signed ^ __pyx_v_dtype_signed));
23421 0 : __pyx_t_2 = __pyx_t_4;
23422 0 : __pyx_L20_bool_binop_done:;
23423 0 : if (__pyx_t_2) {
23424 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_npy_int64, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23425 0 : goto __pyx_L10_break;
23426 : }
23427 : break;
23428 : case 0x66:
23429 : break;
23430 : case 99:
23431 : break;
23432 : case 79:
23433 : break;
23434 : default: break;
23435 : }
23436 : }
23437 : }
23438 0 : __pyx_t_2 = (__pyx_v_arg == Py_None);
23439 0 : if (__pyx_t_2) {
23440 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_npy_int32, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23441 0 : goto __pyx_L10_break;
23442 : }
23443 0 : {
23444 0 : __Pyx_PyThreadState_declare
23445 0 : __Pyx_PyThreadState_assign
23446 0 : __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
23447 0 : __Pyx_XGOTREF(__pyx_t_8);
23448 0 : __Pyx_XGOTREF(__pyx_t_9);
23449 0 : __Pyx_XGOTREF(__pyx_t_10);
23450 0 : /*try:*/ {
23451 0 : __pyx_t_6 = PyMemoryView_FromObject(__pyx_v_arg); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L24_error)
23452 0 : __Pyx_GOTREF(__pyx_t_6);
23453 0 : __pyx_v_arg_as_memoryview = ((PyObject*)__pyx_t_6);
23454 0 : __pyx_t_6 = 0;
23455 : }
23456 0 : /*else:*/ {
23457 0 : __pyx_t_4 = (__pyx_v_itemsize == -1L);
23458 0 : if (!__pyx_t_4) {
23459 0 : goto __pyx_L35_next_or;
23460 : } else {
23461 : }
23462 0 : __pyx_t_5 = __Pyx_PyMemoryView_Get_itemsize(__pyx_v_arg_as_memoryview); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L26_except_error)
23463 0 : __pyx_t_4 = (__pyx_t_5 == (sizeof(npy_int32)));
23464 0 : if (!__pyx_t_4) {
23465 : } else {
23466 0 : goto __pyx_L34_next_and;
23467 : }
23468 0 : __pyx_L35_next_or:;
23469 0 : __pyx_t_4 = (__pyx_v_itemsize == (sizeof(npy_int32)));
23470 0 : if (__pyx_t_4) {
23471 : } else {
23472 0 : __pyx_t_2 = __pyx_t_4;
23473 0 : goto __pyx_L33_bool_binop_done;
23474 : }
23475 0 : __pyx_L34_next_and:;
23476 0 : __pyx_t_11 = __Pyx_PyMemoryView_Get_ndim(__pyx_v_arg_as_memoryview); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L26_except_error)
23477 0 : __pyx_t_4 = (__pyx_t_11 == 1);
23478 0 : __pyx_t_2 = __pyx_t_4;
23479 0 : __pyx_L33_bool_binop_done:;
23480 0 : if (__pyx_t_2) {
23481 0 : __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32(__pyx_v_arg_as_memoryview, 0);
23482 0 : __pyx_v_memslice = __pyx_t_12;
23483 0 : __pyx_t_2 = (__pyx_v_memslice.memview != 0);
23484 0 : if (__pyx_t_2) {
23485 0 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_memslice), 1);
23486 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_npy_int32, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0))) __PYX_ERR(0, 383, __pyx_L26_except_error)
23487 0 : goto __pyx_L29_try_break;
23488 : }
23489 0 : /*else*/ {
23490 0 : PyErr_Clear();
23491 : }
23492 : }
23493 0 : __pyx_t_4 = (__pyx_v_itemsize == -1L);
23494 0 : if (!__pyx_t_4) {
23495 0 : goto __pyx_L41_next_or;
23496 : } else {
23497 : }
23498 0 : __pyx_t_5 = __Pyx_PyMemoryView_Get_itemsize(__pyx_v_arg_as_memoryview); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L26_except_error)
23499 0 : __pyx_t_4 = (__pyx_t_5 == (sizeof(npy_int64)));
23500 0 : if (!__pyx_t_4) {
23501 : } else {
23502 0 : goto __pyx_L40_next_and;
23503 : }
23504 0 : __pyx_L41_next_or:;
23505 0 : __pyx_t_4 = (__pyx_v_itemsize == (sizeof(npy_int64)));
23506 0 : if (__pyx_t_4) {
23507 : } else {
23508 0 : __pyx_t_2 = __pyx_t_4;
23509 0 : goto __pyx_L39_bool_binop_done;
23510 : }
23511 0 : __pyx_L40_next_and:;
23512 0 : __pyx_t_11 = __Pyx_PyMemoryView_Get_ndim(__pyx_v_arg_as_memoryview); if (unlikely(__pyx_t_11 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L26_except_error)
23513 0 : __pyx_t_4 = (__pyx_t_11 == 1);
23514 0 : __pyx_t_2 = __pyx_t_4;
23515 0 : __pyx_L39_bool_binop_done:;
23516 0 : if (__pyx_t_2) {
23517 0 : __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int64(__pyx_v_arg_as_memoryview, 0);
23518 0 : __pyx_v_memslice = __pyx_t_12;
23519 0 : __pyx_t_2 = (__pyx_v_memslice.memview != 0);
23520 0 : if (__pyx_t_2) {
23521 0 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_memslice), 1);
23522 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_npy_int64, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0))) __PYX_ERR(0, 383, __pyx_L26_except_error)
23523 0 : goto __pyx_L29_try_break;
23524 : }
23525 0 : /*else*/ {
23526 0 : PyErr_Clear();
23527 : }
23528 : }
23529 : }
23530 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
23531 0 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
23532 0 : __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
23533 0 : goto __pyx_L31_try_end;
23534 0 : __pyx_L24_error:;
23535 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23536 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23537 0 : __pyx_t_11 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_ValueError, __pyx_builtin_TypeError);
23538 0 : if (__pyx_t_11) {
23539 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
23540 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_13) < 0) __PYX_ERR(0, 383, __pyx_L26_except_error)
23541 0 : __Pyx_XGOTREF(__pyx_t_6);
23542 0 : __Pyx_XGOTREF(__pyx_t_1);
23543 0 : __Pyx_XGOTREF(__pyx_t_13);
23544 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23545 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23546 0 : __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
23547 0 : goto __pyx_L25_exception_handled;
23548 : }
23549 0 : goto __pyx_L26_except_error;
23550 0 : __pyx_L26_except_error:;
23551 0 : __Pyx_XGIVEREF(__pyx_t_8);
23552 0 : __Pyx_XGIVEREF(__pyx_t_9);
23553 0 : __Pyx_XGIVEREF(__pyx_t_10);
23554 0 : __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
23555 0 : goto __pyx_L1_error;
23556 0 : __pyx_L29_try_break:;
23557 0 : __Pyx_XGIVEREF(__pyx_t_8);
23558 0 : __Pyx_XGIVEREF(__pyx_t_9);
23559 0 : __Pyx_XGIVEREF(__pyx_t_10);
23560 0 : __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
23561 0 : goto __pyx_L10_break;
23562 0 : __pyx_L25_exception_handled:;
23563 0 : __Pyx_XGIVEREF(__pyx_t_8);
23564 0 : __Pyx_XGIVEREF(__pyx_t_9);
23565 0 : __Pyx_XGIVEREF(__pyx_t_10);
23566 0 : __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
23567 0 : __pyx_L31_try_end:;
23568 : }
23569 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23570 0 : goto __pyx_L10_break;
23571 : }
23572 55 : __pyx_L10_break:;
23573 55 : __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__fused_sigindex); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23574 55 : __pyx_t_4 = (!__pyx_t_2);
23575 55 : if (__pyx_t_4) {
23576 1 : __pyx_t_5 = 0;
23577 1 : if (unlikely(__pyx_v_signatures == Py_None)) {
23578 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
23579 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23580 : }
23581 2 : __pyx_t_1 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_14), (&__pyx_t_11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23582 1 : __Pyx_GOTREF(__pyx_t_1);
23583 1 : __Pyx_XDECREF(__pyx_t_13);
23584 1 : __pyx_t_13 = __pyx_t_1;
23585 1 : __pyx_t_1 = 0;
23586 3 : while (1) {
23587 3 : __pyx_t_15 = __Pyx_dict_iter_next(__pyx_t_13, __pyx_t_14, &__pyx_t_5, &__pyx_t_1, NULL, NULL, __pyx_t_11);
23588 3 : if (unlikely(__pyx_t_15 == 0)) break;
23589 2 : if (unlikely(__pyx_t_15 == -1)) __PYX_ERR(0, 383, __pyx_L1_error)
23590 2 : __Pyx_GOTREF(__pyx_t_1);
23591 2 : __Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_1);
23592 2 : __pyx_t_1 = 0;
23593 2 : __pyx_t_1 = __pyx_v__fused_sigindex;
23594 2 : __Pyx_INCREF(__pyx_t_1);
23595 2 : __Pyx_XDECREF_SET(__pyx_v_sigindex_node, ((PyObject*)__pyx_t_1));
23596 2 : __pyx_t_1 = 0;
23597 2 : __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 383, __pyx_L1_error)
23598 2 : __Pyx_GOTREF(__pyx_t_16);
23599 2 : __pyx_t_17 = NULL;
23600 2 : __pyx_t_18 = 0;
23601 : #if CYTHON_UNPACK_METHODS
23602 2 : if (likely(PyMethod_Check(__pyx_t_16))) {
23603 0 : __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_16);
23604 0 : if (likely(__pyx_t_17)) {
23605 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
23606 0 : __Pyx_INCREF(__pyx_t_17);
23607 0 : __Pyx_INCREF(function);
23608 0 : __Pyx_DECREF_SET(__pyx_t_16, function);
23609 : __pyx_t_18 = 1;
23610 : }
23611 : }
23612 : #endif
23613 2 : {
23614 2 : PyObject *__pyx_callargs[2] = {__pyx_t_17, __pyx_kp_s__13};
23615 2 : __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_18, 1+__pyx_t_18);
23616 2 : __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
23617 2 : if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23618 2 : __Pyx_GOTREF(__pyx_t_6);
23619 2 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23620 : }
23621 2 : __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_split); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 383, __pyx_L1_error)
23622 2 : __Pyx_GOTREF(__pyx_t_16);
23623 2 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23624 2 : __pyx_t_6 = NULL;
23625 2 : __pyx_t_18 = 0;
23626 : #if CYTHON_UNPACK_METHODS
23627 2 : if (likely(PyMethod_Check(__pyx_t_16))) {
23628 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_16);
23629 0 : if (likely(__pyx_t_6)) {
23630 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
23631 0 : __Pyx_INCREF(__pyx_t_6);
23632 0 : __Pyx_INCREF(function);
23633 0 : __Pyx_DECREF_SET(__pyx_t_16, function);
23634 : __pyx_t_18 = 1;
23635 : }
23636 : }
23637 : #endif
23638 2 : {
23639 2 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_s__14};
23640 2 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_16, __pyx_callargs+1-__pyx_t_18, 1+__pyx_t_18);
23641 2 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
23642 2 : if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23643 2 : __Pyx_GOTREF(__pyx_t_1);
23644 2 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23645 : }
23646 4 : __pyx_t_16 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 383, __pyx_L1_error)
23647 2 : __Pyx_GOTREF(__pyx_t_16);
23648 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23649 2 : __pyx_t_19 = PyList_GET_SIZE(__pyx_t_16);
23650 2 : if (unlikely(__pyx_t_19 < 1)) {
23651 0 : __Pyx_RaiseNeedMoreValuesError(0+__pyx_t_19); __PYX_ERR(0, 383, __pyx_L1_error)
23652 : }
23653 : #if CYTHON_COMPILING_IN_CPYTHON
23654 2 : __pyx_t_6 = PyList_GET_ITEM(__pyx_t_16, __pyx_t_19-1);
23655 2 : ((PyVarObject*)__pyx_t_16)->ob_size--;
23656 : #else
23657 : __pyx_t_6 = PySequence_ITEM(__pyx_t_16, __pyx_t_19-1);
23658 : #endif
23659 2 : __Pyx_GOTREF(__pyx_t_6);
23660 : #if !CYTHON_COMPILING_IN_CPYTHON
23661 : __pyx_t_17 = PySequence_GetSlice(__pyx_t_16, 0, __pyx_t_19-1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 383, __pyx_L1_error)
23662 : __Pyx_GOTREF(__pyx_t_17);
23663 : __Pyx_DECREF(__pyx_t_16);
23664 : __pyx_t_16 = __pyx_t_17; __pyx_t_17 = NULL;
23665 : #else
23666 2 : CYTHON_UNUSED_VAR(__pyx_t_17);
23667 : #endif
23668 2 : __Pyx_XDECREF_SET(__pyx_v_sig_series, ((PyObject*)__pyx_t_16));
23669 2 : __pyx_t_16 = 0;
23670 2 : __Pyx_XDECREF_SET(__pyx_v_last_type, __pyx_t_6);
23671 2 : __pyx_t_6 = 0;
23672 2 : __pyx_t_1 = __pyx_v_sig_series; __Pyx_INCREF(__pyx_t_1);
23673 : __pyx_t_19 = 0;
23674 2 : for (;;) {
23675 2 : {
23676 2 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
23677 : #if !CYTHON_ASSUME_SAFE_MACROS
23678 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23679 : #endif
23680 2 : if (__pyx_t_19 >= __pyx_temp) break;
23681 : }
23682 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23683 0 : __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_6); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23684 : #else
23685 : __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23686 : __Pyx_GOTREF(__pyx_t_6);
23687 : #endif
23688 0 : __Pyx_XDECREF_SET(__pyx_v_sig_type, __pyx_t_6);
23689 0 : __pyx_t_6 = 0;
23690 0 : if (unlikely(__pyx_v_sigindex_node == Py_None)) {
23691 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
23692 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23693 : }
23694 0 : __pyx_t_4 = (__Pyx_PyDict_ContainsTF(__pyx_v_sig_type, __pyx_v_sigindex_node, Py_NE)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23695 0 : if (__pyx_t_4) {
23696 0 : __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23697 0 : __Pyx_GOTREF(__pyx_t_6);
23698 0 : if (unlikely(__pyx_v_sigindex_node == Py_None)) {
23699 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
23700 : __PYX_ERR(0, 383, __pyx_L1_error)
23701 : }
23702 0 : if (unlikely((PyDict_SetItem(__pyx_v_sigindex_node, __pyx_v_sig_type, __pyx_t_6) < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23703 0 : __Pyx_INCREF(__pyx_t_6);
23704 0 : __Pyx_DECREF_SET(__pyx_v_sigindex_node, __pyx_t_6);
23705 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23706 0 : goto __pyx_L51;
23707 : }
23708 0 : /*else*/ {
23709 0 : if (unlikely(__pyx_v_sigindex_node == Py_None)) {
23710 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
23711 : __PYX_ERR(0, 383, __pyx_L1_error)
23712 : }
23713 0 : __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_sigindex_node, __pyx_v_sig_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23714 0 : __Pyx_GOTREF(__pyx_t_6);
23715 0 : __pyx_t_16 = __pyx_t_6;
23716 0 : __Pyx_INCREF(__pyx_t_16);
23717 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23718 2 : __Pyx_DECREF_SET(__pyx_v_sigindex_node, ((PyObject*)__pyx_t_16));
23719 : __pyx_t_16 = 0;
23720 : }
23721 : __pyx_L51:;
23722 : }
23723 2 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23724 2 : if (unlikely(__pyx_v_sigindex_node == Py_None)) {
23725 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
23726 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23727 : }
23728 2 : if (unlikely((PyDict_SetItem(__pyx_v_sigindex_node, __pyx_v_last_type, __pyx_v_sig) < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23729 : }
23730 2 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23731 : }
23732 55 : __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 383, __pyx_L1_error)
23733 55 : __Pyx_GOTREF(__pyx_t_13);
23734 55 : __pyx_v_sigindex_matches = ((PyObject*)__pyx_t_13);
23735 55 : __pyx_t_13 = 0;
23736 55 : __pyx_t_13 = PyList_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 383, __pyx_L1_error)
23737 55 : __Pyx_GOTREF(__pyx_t_13);
23738 55 : __Pyx_INCREF(__pyx_v__fused_sigindex);
23739 55 : __Pyx_GIVEREF(__pyx_v__fused_sigindex);
23740 55 : if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_v__fused_sigindex)) __PYX_ERR(0, 383, __pyx_L1_error);
23741 55 : __pyx_v_sigindex_candidates = ((PyObject*)__pyx_t_13);
23742 55 : __pyx_t_13 = 0;
23743 55 : __pyx_t_13 = __pyx_v_dest_sig; __Pyx_INCREF(__pyx_t_13);
23744 : __pyx_t_14 = 0;
23745 110 : for (;;) {
23746 110 : {
23747 110 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13);
23748 : #if !CYTHON_ASSUME_SAFE_MACROS
23749 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23750 : #endif
23751 110 : if (__pyx_t_14 >= __pyx_temp) break;
23752 : }
23753 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23754 55 : __pyx_t_1 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23755 : #else
23756 : __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23757 : __Pyx_GOTREF(__pyx_t_1);
23758 : #endif
23759 55 : __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_1);
23760 55 : __pyx_t_1 = 0;
23761 55 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23762 55 : __Pyx_GOTREF(__pyx_t_1);
23763 55 : __Pyx_XDECREF_SET(__pyx_v_found_matches, ((PyObject*)__pyx_t_1));
23764 55 : __pyx_t_1 = 0;
23765 55 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23766 55 : __Pyx_GOTREF(__pyx_t_1);
23767 55 : __Pyx_XDECREF_SET(__pyx_v_found_candidates, ((PyObject*)__pyx_t_1));
23768 55 : __pyx_t_1 = 0;
23769 55 : __pyx_t_4 = (__pyx_v_dst_type == Py_None);
23770 55 : if (__pyx_t_4) {
23771 0 : __pyx_t_1 = __pyx_v_sigindex_matches; __Pyx_INCREF(__pyx_t_1);
23772 0 : __pyx_t_5 = 0;
23773 0 : for (;;) {
23774 0 : {
23775 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
23776 : #if !CYTHON_ASSUME_SAFE_MACROS
23777 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23778 : #endif
23779 0 : if (__pyx_t_5 >= __pyx_temp) break;
23780 : }
23781 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23782 0 : __pyx_t_16 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_16); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23783 : #else
23784 : __pyx_t_16 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 383, __pyx_L1_error)
23785 : __Pyx_GOTREF(__pyx_t_16);
23786 : #endif
23787 0 : __Pyx_XDECREF_SET(__pyx_v_sn, __pyx_t_16);
23788 0 : __pyx_t_16 = 0;
23789 0 : if (unlikely(__pyx_v_sn == Py_None)) {
23790 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
23791 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23792 : }
23793 0 : __pyx_t_16 = __Pyx_PyDict_Values(((PyObject*)__pyx_v_sn)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 383, __pyx_L1_error)
23794 0 : __Pyx_GOTREF(__pyx_t_16);
23795 0 : __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_found_matches, __pyx_t_16); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 383, __pyx_L1_error)
23796 0 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23797 : }
23798 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23799 0 : __pyx_t_1 = __pyx_v_sigindex_candidates; __Pyx_INCREF(__pyx_t_1);
23800 0 : __pyx_t_5 = 0;
23801 0 : for (;;) {
23802 0 : {
23803 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
23804 : #if !CYTHON_ASSUME_SAFE_MACROS
23805 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23806 : #endif
23807 0 : if (__pyx_t_5 >= __pyx_temp) break;
23808 : }
23809 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23810 0 : __pyx_t_16 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_16); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23811 : #else
23812 : __pyx_t_16 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 383, __pyx_L1_error)
23813 : __Pyx_GOTREF(__pyx_t_16);
23814 : #endif
23815 0 : __Pyx_XDECREF_SET(__pyx_v_sn, __pyx_t_16);
23816 0 : __pyx_t_16 = 0;
23817 0 : if (unlikely(__pyx_v_sn == Py_None)) {
23818 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
23819 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23820 : }
23821 0 : __pyx_t_16 = __Pyx_PyDict_Values(((PyObject*)__pyx_v_sn)); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 383, __pyx_L1_error)
23822 0 : __Pyx_GOTREF(__pyx_t_16);
23823 0 : __pyx_t_20 = __Pyx_PyList_Extend(__pyx_v_found_candidates, __pyx_t_16); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 383, __pyx_L1_error)
23824 0 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23825 : }
23826 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23827 0 : goto __pyx_L55;
23828 : }
23829 55 : /*else*/ {
23830 55 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23831 55 : __Pyx_GOTREF(__pyx_t_1);
23832 55 : __Pyx_INCREF(__pyx_v_sigindex_matches);
23833 55 : __Pyx_GIVEREF(__pyx_v_sigindex_matches);
23834 55 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_sigindex_matches)) __PYX_ERR(0, 383, __pyx_L1_error);
23835 55 : __Pyx_INCREF(__pyx_v_sigindex_candidates);
23836 55 : __Pyx_GIVEREF(__pyx_v_sigindex_candidates);
23837 55 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_sigindex_candidates)) __PYX_ERR(0, 383, __pyx_L1_error);
23838 55 : __pyx_t_16 = __pyx_t_1; __Pyx_INCREF(__pyx_t_16);
23839 55 : __pyx_t_5 = 0;
23840 110 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23841 275 : for (;;) {
23842 165 : if (__pyx_t_5 >= 2) break;
23843 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23844 110 : __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_16, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23845 : #else
23846 : __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_16, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
23847 : __Pyx_GOTREF(__pyx_t_1);
23848 : #endif
23849 110 : __Pyx_XDECREF_SET(__pyx_v_search_list, ((PyObject*)__pyx_t_1));
23850 110 : __pyx_t_1 = 0;
23851 110 : if (unlikely(__pyx_v_search_list == Py_None)) {
23852 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
23853 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23854 : }
23855 110 : __pyx_t_1 = __pyx_v_search_list; __Pyx_INCREF(__pyx_t_1);
23856 : __pyx_t_19 = 0;
23857 165 : for (;;) {
23858 165 : {
23859 165 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
23860 : #if !CYTHON_ASSUME_SAFE_MACROS
23861 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23862 : #endif
23863 165 : if (__pyx_t_19 >= __pyx_temp) break;
23864 : }
23865 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23866 55 : __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_19); __Pyx_INCREF(__pyx_t_6); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
23867 : #else
23868 : __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23869 : __Pyx_GOTREF(__pyx_t_6);
23870 : #endif
23871 55 : __Pyx_XDECREF_SET(__pyx_v_sn, __pyx_t_6);
23872 55 : __pyx_t_6 = 0;
23873 55 : if (unlikely(__pyx_v_sn == Py_None)) {
23874 0 : PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
23875 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23876 : }
23877 55 : __pyx_t_6 = __Pyx_PyDict_GetItemDefault(((PyObject*)__pyx_v_sn), __pyx_v_dst_type, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
23878 55 : __Pyx_GOTREF(__pyx_t_6);
23879 55 : __Pyx_XDECREF_SET(__pyx_v_type_match, __pyx_t_6);
23880 55 : __pyx_t_6 = 0;
23881 55 : __pyx_t_4 = (__pyx_v_type_match != Py_None);
23882 55 : if (__pyx_t_4) {
23883 55 : __pyx_t_20 = __Pyx_PyList_Append(__pyx_v_found_matches, __pyx_v_type_match); if (unlikely(__pyx_t_20 == ((int)-1))) __PYX_ERR(0, 383, __pyx_L1_error)
23884 : }
23885 : }
23886 110 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23887 110 : }
23888 55 : __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
23889 : }
23890 55 : __pyx_L55:;
23891 55 : __Pyx_INCREF(__pyx_v_found_matches);
23892 55 : __Pyx_DECREF_SET(__pyx_v_sigindex_matches, __pyx_v_found_matches);
23893 55 : __Pyx_INCREF(__pyx_v_found_candidates);
23894 55 : __Pyx_DECREF_SET(__pyx_v_sigindex_candidates, __pyx_v_found_candidates);
23895 55 : __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_found_matches) != 0);
23896 55 : if (!__pyx_t_2) {
23897 : } else {
23898 55 : __pyx_t_4 = __pyx_t_2;
23899 55 : goto __pyx_L70_bool_binop_done;
23900 : }
23901 0 : __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_found_candidates) != 0);
23902 0 : __pyx_t_4 = __pyx_t_2;
23903 55 : __pyx_L70_bool_binop_done:;
23904 55 : __pyx_t_2 = (!__pyx_t_4);
23905 55 : if (__pyx_t_2) {
23906 0 : goto __pyx_L54_break;
23907 : }
23908 : }
23909 55 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23910 55 : goto __pyx_L72_for_end;
23911 0 : __pyx_L54_break:;
23912 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23913 0 : goto __pyx_L72_for_end;
23914 55 : __pyx_L72_for_end:;
23915 55 : __Pyx_INCREF(__pyx_v_sigindex_matches);
23916 55 : __pyx_v_candidates = __pyx_v_sigindex_matches;
23917 55 : __pyx_t_2 = (PyList_GET_SIZE(__pyx_v_candidates) != 0);
23918 55 : __pyx_t_4 = (!__pyx_t_2);
23919 55 : if (unlikely(__pyx_t_4)) {
23920 0 : __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 383, __pyx_L1_error)
23921 0 : __Pyx_GOTREF(__pyx_t_13);
23922 0 : __Pyx_Raise(__pyx_t_13, 0, 0, 0);
23923 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23924 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23925 : }
23926 55 : __pyx_t_14 = __Pyx_PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 383, __pyx_L1_error)
23927 55 : __pyx_t_4 = (__pyx_t_14 > 1);
23928 55 : if (unlikely(__pyx_t_4)) {
23929 0 : __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 383, __pyx_L1_error)
23930 0 : __Pyx_GOTREF(__pyx_t_13);
23931 0 : __Pyx_Raise(__pyx_t_13, 0, 0, 0);
23932 0 : __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
23933 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23934 : }
23935 55 : /*else*/ {
23936 55 : __Pyx_XDECREF(__pyx_r);
23937 55 : if (unlikely(__pyx_v_signatures == Py_None)) {
23938 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
23939 0 : __PYX_ERR(0, 383, __pyx_L1_error)
23940 : }
23941 55 : __pyx_t_13 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 383, __pyx_L1_error)
23942 55 : __Pyx_GOTREF(__pyx_t_13);
23943 55 : __pyx_r = __pyx_t_13;
23944 55 : __pyx_t_13 = 0;
23945 55 : goto __pyx_L0;
23946 : }
23947 :
23948 : /* function exit code */
23949 0 : __pyx_L1_error:;
23950 0 : __Pyx_XDECREF(__pyx_t_1);
23951 0 : __Pyx_XDECREF(__pyx_t_6);
23952 0 : __Pyx_XDECREF(__pyx_t_13);
23953 0 : __Pyx_XDECREF(__pyx_t_16);
23954 0 : __Pyx_XDECREF(__pyx_t_17);
23955 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
23956 : __pyx_r = NULL;
23957 55 : __pyx_L0:;
23958 55 : __Pyx_XDECREF(__pyx_v_search_list);
23959 55 : __Pyx_XDECREF(__pyx_v_sigindex_node);
23960 55 : __Pyx_XDECREF(__pyx_v_dest_sig);
23961 55 : __Pyx_XDECREF((PyObject *)__pyx_v_ndarray);
23962 55 : __Pyx_XDECREF(__pyx_v_arg_as_memoryview);
23963 55 : __Pyx_XDECREF(__pyx_v_arg);
23964 55 : __Pyx_XDECREF(__pyx_v_dtype);
23965 55 : __Pyx_XDECREF(__pyx_v_arg_base);
23966 55 : __Pyx_XDECREF(__pyx_v_sig);
23967 55 : __Pyx_XDECREF(__pyx_v_sig_series);
23968 55 : __Pyx_XDECREF(__pyx_v_last_type);
23969 55 : __Pyx_XDECREF(__pyx_v_sig_type);
23970 55 : __Pyx_XDECREF(__pyx_v_sigindex_matches);
23971 55 : __Pyx_XDECREF(__pyx_v_sigindex_candidates);
23972 55 : __Pyx_XDECREF(__pyx_v_dst_type);
23973 55 : __Pyx_XDECREF(__pyx_v_found_matches);
23974 55 : __Pyx_XDECREF(__pyx_v_found_candidates);
23975 55 : __Pyx_XDECREF(__pyx_v_sn);
23976 55 : __Pyx_XDECREF(__pyx_v_type_match);
23977 55 : __Pyx_XDECREF(__pyx_v_candidates);
23978 55 : __Pyx_XDECREF(__pyx_v_kwargs);
23979 55 : __Pyx_XGIVEREF(__pyx_r);
23980 55 : __Pyx_RefNannyFinishContext();
23981 55 : return __pyx_r;
23982 : }
23983 :
23984 : /* Python wrapper */
23985 : static PyObject *__pyx_fuse_0__pyx_pw_5scipy_11interpolate_5_bspl_25_make_design_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23986 : static PyMethodDef __pyx_fuse_0__pyx_mdef_5scipy_11interpolate_5_bspl_25_make_design_matrix = {"__pyx_fuse_0_make_design_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_0__pyx_pw_5scipy_11interpolate_5_bspl_25_make_design_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_10_make_design_matrix};
23987 55 : static PyObject *__pyx_fuse_0__pyx_pw_5scipy_11interpolate_5_bspl_25_make_design_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23988 55 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
23989 55 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
23990 55 : int __pyx_v_k;
23991 55 : int __pyx_v_extrapolate;
23992 55 : __Pyx_memviewslice __pyx_v_indices = { 0, 0, { 0 }, { 0 }, { 0 } };
23993 55 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
23994 55 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
23995 55 : PyObject* values[5] = {0,0,0,0,0};
23996 55 : int __pyx_lineno = 0;
23997 55 : const char *__pyx_filename = NULL;
23998 55 : int __pyx_clineno = 0;
23999 55 : PyObject *__pyx_r = 0;
24000 : __Pyx_RefNannyDeclarations
24001 55 : __Pyx_RefNannySetupContext("_make_design_matrix (wrapper)", 0);
24002 : #if CYTHON_ASSUME_SAFE_MACROS
24003 55 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24004 : #else
24005 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24006 : #endif
24007 55 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
24008 55 : {
24009 55 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_k,&__pyx_n_s_extrapolate,&__pyx_n_s_indices,0};
24010 55 : if (__pyx_kwds) {
24011 0 : Py_ssize_t kw_args;
24012 0 : switch (__pyx_nargs) {
24013 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
24014 0 : CYTHON_FALLTHROUGH;
24015 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
24016 0 : CYTHON_FALLTHROUGH;
24017 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
24018 0 : CYTHON_FALLTHROUGH;
24019 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
24020 0 : CYTHON_FALLTHROUGH;
24021 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
24022 0 : CYTHON_FALLTHROUGH;
24023 0 : case 0: break;
24024 0 : default: goto __pyx_L5_argtuple_error;
24025 : }
24026 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
24027 0 : switch (__pyx_nargs) {
24028 0 : case 0:
24029 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
24030 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
24031 0 : kw_args--;
24032 : }
24033 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24034 0 : else goto __pyx_L5_argtuple_error;
24035 0 : CYTHON_FALLTHROUGH;
24036 0 : case 1:
24037 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
24038 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
24039 0 : kw_args--;
24040 : }
24041 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24042 : else {
24043 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, 1); __PYX_ERR(0, 383, __pyx_L3_error)
24044 : }
24045 0 : CYTHON_FALLTHROUGH;
24046 0 : case 2:
24047 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
24048 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
24049 0 : kw_args--;
24050 : }
24051 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24052 : else {
24053 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, 2); __PYX_ERR(0, 383, __pyx_L3_error)
24054 : }
24055 0 : CYTHON_FALLTHROUGH;
24056 0 : case 3:
24057 0 : if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_extrapolate)) != 0)) {
24058 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[3]);
24059 0 : kw_args--;
24060 : }
24061 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24062 : else {
24063 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, 3); __PYX_ERR(0, 383, __pyx_L3_error)
24064 : }
24065 0 : CYTHON_FALLTHROUGH;
24066 0 : case 4:
24067 0 : if (likely((values[4] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) {
24068 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[4]);
24069 0 : kw_args--;
24070 : }
24071 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24072 : else {
24073 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, 4); __PYX_ERR(0, 383, __pyx_L3_error)
24074 : }
24075 : }
24076 0 : if (unlikely(kw_args > 0)) {
24077 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
24078 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_make_design_matrix") < 0)) __PYX_ERR(0, 383, __pyx_L3_error)
24079 : }
24080 55 : } else if (unlikely(__pyx_nargs != 5)) {
24081 0 : goto __pyx_L5_argtuple_error;
24082 : } else {
24083 55 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
24084 55 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
24085 55 : values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
24086 55 : values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
24087 55 : values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
24088 : }
24089 55 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 385, __pyx_L3_error)
24090 55 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 386, __pyx_L3_error)
24091 55 : __pyx_v_k = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error)
24092 55 : __pyx_v_extrapolate = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_extrapolate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error)
24093 55 : __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 389, __pyx_L3_error)
24094 : }
24095 55 : goto __pyx_L6_skip;
24096 0 : __pyx_L5_argtuple_error:;
24097 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 383, __pyx_L3_error)
24098 55 : __pyx_L6_skip:;
24099 55 : goto __pyx_L4_argument_unpacking_done;
24100 0 : __pyx_L3_error:;
24101 0 : {
24102 0 : Py_ssize_t __pyx_temp;
24103 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24104 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
24105 : }
24106 : }
24107 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
24108 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
24109 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_indices, 1);
24110 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._make_design_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
24111 : __Pyx_RefNannyFinishContext();
24112 : return NULL;
24113 55 : __pyx_L4_argument_unpacking_done:;
24114 55 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_24_make_design_matrix(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_k, __pyx_v_extrapolate, __pyx_v_indices);
24115 :
24116 : /* function exit code */
24117 55 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
24118 55 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
24119 55 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_indices, 1);
24120 : {
24121 : Py_ssize_t __pyx_temp;
24122 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24123 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
24124 : }
24125 : }
24126 : __Pyx_RefNannyFinishContext();
24127 : return __pyx_r;
24128 : }
24129 :
24130 55 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_24_make_design_matrix(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, int __pyx_v_extrapolate, __Pyx_memviewslice __pyx_v_indices) {
24131 55 : npy_intp __pyx_v_i;
24132 55 : npy_intp __pyx_v_j;
24133 55 : npy_intp __pyx_v_m;
24134 55 : npy_intp __pyx_v_ind;
24135 55 : npy_intp __pyx_v_n;
24136 55 : __Pyx_memviewslice __pyx_v_work = { 0, 0, { 0 }, { 0 }, { 0 } };
24137 55 : __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
24138 55 : double __pyx_v_xval;
24139 55 : PyObject *__pyx_r = NULL;
24140 : __Pyx_RefNannyDeclarations
24141 55 : PyObject *__pyx_t_1 = NULL;
24142 55 : PyObject *__pyx_t_2 = NULL;
24143 55 : PyObject *__pyx_t_3 = NULL;
24144 55 : PyObject *__pyx_t_4 = NULL;
24145 55 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
24146 55 : npy_intp __pyx_t_6;
24147 55 : npy_intp __pyx_t_7;
24148 55 : npy_intp __pyx_t_8;
24149 55 : Py_ssize_t __pyx_t_9;
24150 55 : Py_ssize_t __pyx_t_10;
24151 55 : long __pyx_t_11;
24152 55 : long __pyx_t_12;
24153 55 : npy_intp __pyx_t_13;
24154 55 : unsigned int __pyx_t_14;
24155 55 : PyObject *__pyx_t_15 = NULL;
24156 55 : int __pyx_lineno = 0;
24157 55 : const char *__pyx_filename = NULL;
24158 55 : int __pyx_clineno = 0;
24159 55 : __Pyx_RefNannySetupContext("__pyx_fuse_0_make_design_matrix", 1);
24160 :
24161 : /* "scipy/interpolate/_bspl.pyx":421
24162 : * cdef:
24163 : * cnp.npy_intp i, j, m, ind
24164 : * cnp.npy_intp n = x.shape[0] # <<<<<<<<<<<<<<
24165 : * double[::1] work = np.empty(2*k+2, dtype=float)
24166 : * double[::1] data = np.zeros(n * (k + 1), dtype=float)
24167 : */
24168 55 : __pyx_v_n = (__pyx_v_x.shape[0]);
24169 :
24170 : /* "scipy/interpolate/_bspl.pyx":422
24171 : * cnp.npy_intp i, j, m, ind
24172 : * cnp.npy_intp n = x.shape[0]
24173 : * double[::1] work = np.empty(2*k+2, dtype=float) # <<<<<<<<<<<<<<
24174 : * double[::1] data = np.zeros(n * (k + 1), dtype=float)
24175 : * double xval
24176 : */
24177 55 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
24178 55 : __Pyx_GOTREF(__pyx_t_1);
24179 55 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
24180 55 : __Pyx_GOTREF(__pyx_t_2);
24181 55 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24182 55 : __pyx_t_1 = __Pyx_PyInt_From_long(((2 * __pyx_v_k) + 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
24183 55 : __Pyx_GOTREF(__pyx_t_1);
24184 55 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
24185 55 : __Pyx_GOTREF(__pyx_t_3);
24186 55 : __Pyx_GIVEREF(__pyx_t_1);
24187 55 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error);
24188 55 : __pyx_t_1 = 0;
24189 55 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
24190 55 : __Pyx_GOTREF(__pyx_t_1);
24191 55 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 422, __pyx_L1_error)
24192 55 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
24193 55 : __Pyx_GOTREF(__pyx_t_4);
24194 55 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24195 55 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24196 55 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24197 55 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 422, __pyx_L1_error)
24198 55 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24199 55 : __pyx_v_work = __pyx_t_5;
24200 55 : __pyx_t_5.memview = NULL;
24201 55 : __pyx_t_5.data = NULL;
24202 :
24203 : /* "scipy/interpolate/_bspl.pyx":423
24204 : * cnp.npy_intp n = x.shape[0]
24205 : * double[::1] work = np.empty(2*k+2, dtype=float)
24206 : * double[::1] data = np.zeros(n * (k + 1), dtype=float) # <<<<<<<<<<<<<<
24207 : * double xval
24208 : * ind = k
24209 : */
24210 55 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
24211 55 : __Pyx_GOTREF(__pyx_t_4);
24212 55 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
24213 55 : __Pyx_GOTREF(__pyx_t_1);
24214 55 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24215 55 : __pyx_t_4 = __Pyx_PyInt_From_npy_intp((__pyx_v_n * (__pyx_v_k + 1))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
24216 55 : __Pyx_GOTREF(__pyx_t_4);
24217 55 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error)
24218 55 : __Pyx_GOTREF(__pyx_t_3);
24219 55 : __Pyx_GIVEREF(__pyx_t_4);
24220 55 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error);
24221 55 : __pyx_t_4 = 0;
24222 55 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
24223 55 : __Pyx_GOTREF(__pyx_t_4);
24224 55 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
24225 55 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
24226 55 : __Pyx_GOTREF(__pyx_t_2);
24227 55 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24228 55 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24229 55 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24230 55 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 423, __pyx_L1_error)
24231 55 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24232 55 : __pyx_v_data = __pyx_t_5;
24233 55 : __pyx_t_5.memview = NULL;
24234 55 : __pyx_t_5.data = NULL;
24235 :
24236 : /* "scipy/interpolate/_bspl.pyx":425
24237 : * double[::1] data = np.zeros(n * (k + 1), dtype=float)
24238 : * double xval
24239 : * ind = k # <<<<<<<<<<<<<<
24240 : * for i in range(n):
24241 : * xval = x[i]
24242 : */
24243 55 : __pyx_v_ind = __pyx_v_k;
24244 :
24245 : /* "scipy/interpolate/_bspl.pyx":426
24246 : * double xval
24247 : * ind = k
24248 : * for i in range(n): # <<<<<<<<<<<<<<
24249 : * xval = x[i]
24250 : *
24251 : */
24252 55 : __pyx_t_6 = __pyx_v_n;
24253 55 : __pyx_t_7 = __pyx_t_6;
24254 1962 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
24255 1907 : __pyx_v_i = __pyx_t_8;
24256 :
24257 : /* "scipy/interpolate/_bspl.pyx":427
24258 : * ind = k
24259 : * for i in range(n):
24260 : * xval = x[i] # <<<<<<<<<<<<<<
24261 : *
24262 : * # Find correct interval. Note that interval >= 0 always as
24263 : */
24264 1907 : __pyx_t_9 = __pyx_v_i;
24265 1907 : __pyx_v_xval = (*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_x.data) + __pyx_t_9)) )));
24266 :
24267 : /* "scipy/interpolate/_bspl.pyx":432
24268 : * # extrapolate=False and out of bound values are already dealt with in
24269 : * # design_matrix
24270 : * ind = find_interval(t, k, xval, ind, extrapolate) # <<<<<<<<<<<<<<
24271 : * _deBoor_D(&t[0], xval, k, ind, 0, &work[0])
24272 : *
24273 : */
24274 1907 : __pyx_v_ind = __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__pyx_v_t, __pyx_v_k, __pyx_v_xval, __pyx_v_ind, __pyx_v_extrapolate);
24275 :
24276 : /* "scipy/interpolate/_bspl.pyx":433
24277 : * # design_matrix
24278 : * ind = find_interval(t, k, xval, ind, extrapolate)
24279 : * _deBoor_D(&t[0], xval, k, ind, 0, &work[0]) # <<<<<<<<<<<<<<
24280 : *
24281 : * # data[(k + 1) * i : (k + 1) * (i + 1)] = work[:k + 1]
24282 : */
24283 1907 : __pyx_t_9 = 0;
24284 1907 : __pyx_t_10 = 0;
24285 1907 : fitpack::_deBoor_D((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_9)) )))), __pyx_v_xval, __pyx_v_k, __pyx_v_ind, 0, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_work.data) + __pyx_t_10)) )))));
24286 :
24287 : /* "scipy/interpolate/_bspl.pyx":437
24288 : * # data[(k + 1) * i : (k + 1) * (i + 1)] = work[:k + 1]
24289 : * # indices[(k + 1) * i : (k + 1) * (i + 1)] = np.arange(ind - k, ind + 1)
24290 : * for j in range(k + 1): # <<<<<<<<<<<<<<
24291 : * m = (k + 1) * i + j
24292 : * data[m] = work[j]
24293 : */
24294 : __pyx_t_11 = (__pyx_v_k + 1);
24295 : __pyx_t_12 = __pyx_t_11;
24296 9436 : for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
24297 7529 : __pyx_v_j = __pyx_t_13;
24298 :
24299 : /* "scipy/interpolate/_bspl.pyx":438
24300 : * # indices[(k + 1) * i : (k + 1) * (i + 1)] = np.arange(ind - k, ind + 1)
24301 : * for j in range(k + 1):
24302 : * m = (k + 1) * i + j # <<<<<<<<<<<<<<
24303 : * data[m] = work[j]
24304 : * indices[m] = ind - k + j
24305 : */
24306 7529 : __pyx_v_m = (((__pyx_v_k + 1) * __pyx_v_i) + __pyx_v_j);
24307 :
24308 : /* "scipy/interpolate/_bspl.pyx":439
24309 : * for j in range(k + 1):
24310 : * m = (k + 1) * i + j
24311 : * data[m] = work[j] # <<<<<<<<<<<<<<
24312 : * indices[m] = ind - k + j
24313 : *
24314 : */
24315 7529 : __pyx_t_10 = __pyx_v_j;
24316 7529 : __pyx_t_9 = __pyx_v_m;
24317 7529 : *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_9)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_work.data) + __pyx_t_10)) )));
24318 :
24319 : /* "scipy/interpolate/_bspl.pyx":440
24320 : * m = (k + 1) * i + j
24321 : * data[m] = work[j]
24322 : * indices[m] = ind - k + j # <<<<<<<<<<<<<<
24323 : *
24324 : * return np.asarray(data), np.asarray(indices)
24325 : */
24326 7529 : __pyx_t_10 = __pyx_v_m;
24327 7529 : *((npy_int32 *) ( /* dim=0 */ ((char *) (((npy_int32 *) __pyx_v_indices.data) + __pyx_t_10)) )) = ((__pyx_v_ind - __pyx_v_k) + __pyx_v_j);
24328 : }
24329 : }
24330 :
24331 : /* "scipy/interpolate/_bspl.pyx":442
24332 : * indices[m] = ind - k + j
24333 : *
24334 : * return np.asarray(data), np.asarray(indices) # <<<<<<<<<<<<<<
24335 : *
24336 : *
24337 : */
24338 55 : __Pyx_XDECREF(__pyx_r);
24339 55 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
24340 55 : __Pyx_GOTREF(__pyx_t_4);
24341 55 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
24342 55 : __Pyx_GOTREF(__pyx_t_3);
24343 55 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24344 55 : __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
24345 55 : __Pyx_GOTREF(__pyx_t_4);
24346 55 : __pyx_t_1 = NULL;
24347 55 : __pyx_t_14 = 0;
24348 : #if CYTHON_UNPACK_METHODS
24349 55 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
24350 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
24351 0 : if (likely(__pyx_t_1)) {
24352 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
24353 0 : __Pyx_INCREF(__pyx_t_1);
24354 0 : __Pyx_INCREF(function);
24355 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
24356 : __pyx_t_14 = 1;
24357 : }
24358 : }
24359 : #endif
24360 55 : {
24361 55 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
24362 55 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
24363 55 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24364 55 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24365 55 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
24366 55 : __Pyx_GOTREF(__pyx_t_2);
24367 55 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24368 : }
24369 55 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
24370 55 : __Pyx_GOTREF(__pyx_t_4);
24371 55 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
24372 55 : __Pyx_GOTREF(__pyx_t_1);
24373 55 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24374 55 : __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_indices, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_npy_int32, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_npy_int32, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
24375 55 : __Pyx_GOTREF(__pyx_t_4);
24376 55 : __pyx_t_15 = NULL;
24377 55 : __pyx_t_14 = 0;
24378 : #if CYTHON_UNPACK_METHODS
24379 55 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
24380 0 : __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_1);
24381 0 : if (likely(__pyx_t_15)) {
24382 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
24383 0 : __Pyx_INCREF(__pyx_t_15);
24384 0 : __Pyx_INCREF(function);
24385 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
24386 : __pyx_t_14 = 1;
24387 : }
24388 : }
24389 : #endif
24390 55 : {
24391 55 : PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_4};
24392 55 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
24393 55 : __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
24394 55 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24395 55 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
24396 55 : __Pyx_GOTREF(__pyx_t_3);
24397 55 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24398 : }
24399 55 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
24400 55 : __Pyx_GOTREF(__pyx_t_1);
24401 55 : __Pyx_GIVEREF(__pyx_t_2);
24402 55 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error);
24403 55 : __Pyx_GIVEREF(__pyx_t_3);
24404 55 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error);
24405 55 : __pyx_t_2 = 0;
24406 55 : __pyx_t_3 = 0;
24407 55 : __pyx_r = __pyx_t_1;
24408 55 : __pyx_t_1 = 0;
24409 55 : goto __pyx_L0;
24410 :
24411 : /* "scipy/interpolate/_bspl.pyx":383
24412 : * rhs[row, ci] = rhs[row, ci] + wrk[r] * y[j, ci] * wval
24413 : *
24414 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
24415 : * @cython.boundscheck(False)
24416 : * def _make_design_matrix(const double[::1] x,
24417 : */
24418 :
24419 : /* function exit code */
24420 0 : __pyx_L1_error:;
24421 0 : __Pyx_XDECREF(__pyx_t_1);
24422 0 : __Pyx_XDECREF(__pyx_t_2);
24423 0 : __Pyx_XDECREF(__pyx_t_3);
24424 0 : __Pyx_XDECREF(__pyx_t_4);
24425 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
24426 0 : __Pyx_XDECREF(__pyx_t_15);
24427 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._make_design_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
24428 : __pyx_r = NULL;
24429 55 : __pyx_L0:;
24430 55 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_work, 1);
24431 55 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_data, 1);
24432 55 : __Pyx_XGIVEREF(__pyx_r);
24433 55 : __Pyx_RefNannyFinishContext();
24434 55 : return __pyx_r;
24435 : }
24436 :
24437 : /* Python wrapper */
24438 : static PyObject *__pyx_fuse_1__pyx_pw_5scipy_11interpolate_5_bspl_27_make_design_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
24439 : static PyMethodDef __pyx_fuse_1__pyx_mdef_5scipy_11interpolate_5_bspl_27_make_design_matrix = {"__pyx_fuse_1_make_design_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_fuse_1__pyx_pw_5scipy_11interpolate_5_bspl_27_make_design_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_10_make_design_matrix};
24440 0 : static PyObject *__pyx_fuse_1__pyx_pw_5scipy_11interpolate_5_bspl_27_make_design_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
24441 0 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
24442 0 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
24443 0 : int __pyx_v_k;
24444 0 : int __pyx_v_extrapolate;
24445 0 : __Pyx_memviewslice __pyx_v_indices = { 0, 0, { 0 }, { 0 }, { 0 } };
24446 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24447 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24448 0 : PyObject* values[5] = {0,0,0,0,0};
24449 0 : int __pyx_lineno = 0;
24450 0 : const char *__pyx_filename = NULL;
24451 0 : int __pyx_clineno = 0;
24452 0 : PyObject *__pyx_r = 0;
24453 : __Pyx_RefNannyDeclarations
24454 0 : __Pyx_RefNannySetupContext("_make_design_matrix (wrapper)", 0);
24455 : #if CYTHON_ASSUME_SAFE_MACROS
24456 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24457 : #else
24458 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24459 : #endif
24460 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
24461 0 : {
24462 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_k,&__pyx_n_s_extrapolate,&__pyx_n_s_indices,0};
24463 0 : if (__pyx_kwds) {
24464 0 : Py_ssize_t kw_args;
24465 0 : switch (__pyx_nargs) {
24466 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
24467 0 : CYTHON_FALLTHROUGH;
24468 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
24469 0 : CYTHON_FALLTHROUGH;
24470 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
24471 0 : CYTHON_FALLTHROUGH;
24472 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
24473 0 : CYTHON_FALLTHROUGH;
24474 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
24475 0 : CYTHON_FALLTHROUGH;
24476 0 : case 0: break;
24477 0 : default: goto __pyx_L5_argtuple_error;
24478 : }
24479 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
24480 0 : switch (__pyx_nargs) {
24481 0 : case 0:
24482 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
24483 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
24484 0 : kw_args--;
24485 : }
24486 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24487 0 : else goto __pyx_L5_argtuple_error;
24488 0 : CYTHON_FALLTHROUGH;
24489 0 : case 1:
24490 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
24491 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
24492 0 : kw_args--;
24493 : }
24494 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24495 : else {
24496 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, 1); __PYX_ERR(0, 383, __pyx_L3_error)
24497 : }
24498 0 : CYTHON_FALLTHROUGH;
24499 0 : case 2:
24500 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
24501 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
24502 0 : kw_args--;
24503 : }
24504 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24505 : else {
24506 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, 2); __PYX_ERR(0, 383, __pyx_L3_error)
24507 : }
24508 0 : CYTHON_FALLTHROUGH;
24509 0 : case 3:
24510 0 : if (likely((values[3] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_extrapolate)) != 0)) {
24511 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[3]);
24512 0 : kw_args--;
24513 : }
24514 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24515 : else {
24516 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, 3); __PYX_ERR(0, 383, __pyx_L3_error)
24517 : }
24518 0 : CYTHON_FALLTHROUGH;
24519 0 : case 4:
24520 0 : if (likely((values[4] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices)) != 0)) {
24521 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[4]);
24522 0 : kw_args--;
24523 : }
24524 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 383, __pyx_L3_error)
24525 : else {
24526 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, 4); __PYX_ERR(0, 383, __pyx_L3_error)
24527 : }
24528 : }
24529 0 : if (unlikely(kw_args > 0)) {
24530 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
24531 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_make_design_matrix") < 0)) __PYX_ERR(0, 383, __pyx_L3_error)
24532 : }
24533 0 : } else if (unlikely(__pyx_nargs != 5)) {
24534 0 : goto __pyx_L5_argtuple_error;
24535 : } else {
24536 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
24537 0 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
24538 0 : values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
24539 0 : values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
24540 0 : values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
24541 : }
24542 0 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 385, __pyx_L3_error)
24543 0 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 386, __pyx_L3_error)
24544 0 : __pyx_v_k = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 387, __pyx_L3_error)
24545 0 : __pyx_v_extrapolate = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_extrapolate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L3_error)
24546 0 : __pyx_v_indices = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int64(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_indices.memview)) __PYX_ERR(0, 389, __pyx_L3_error)
24547 : }
24548 0 : goto __pyx_L6_skip;
24549 0 : __pyx_L5_argtuple_error:;
24550 0 : __Pyx_RaiseArgtupleInvalid("_make_design_matrix", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 383, __pyx_L3_error)
24551 0 : __pyx_L6_skip:;
24552 0 : goto __pyx_L4_argument_unpacking_done;
24553 0 : __pyx_L3_error:;
24554 0 : {
24555 0 : Py_ssize_t __pyx_temp;
24556 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24557 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
24558 : }
24559 : }
24560 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
24561 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
24562 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_indices, 1);
24563 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._make_design_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
24564 : __Pyx_RefNannyFinishContext();
24565 : return NULL;
24566 0 : __pyx_L4_argument_unpacking_done:;
24567 0 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_26_make_design_matrix(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_k, __pyx_v_extrapolate, __pyx_v_indices);
24568 :
24569 : /* function exit code */
24570 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
24571 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
24572 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_indices, 1);
24573 : {
24574 : Py_ssize_t __pyx_temp;
24575 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
24576 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
24577 : }
24578 : }
24579 : __Pyx_RefNannyFinishContext();
24580 : return __pyx_r;
24581 : }
24582 :
24583 0 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_26_make_design_matrix(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, int __pyx_v_extrapolate, __Pyx_memviewslice __pyx_v_indices) {
24584 0 : npy_intp __pyx_v_i;
24585 0 : npy_intp __pyx_v_j;
24586 0 : npy_intp __pyx_v_m;
24587 0 : npy_intp __pyx_v_ind;
24588 0 : npy_intp __pyx_v_n;
24589 0 : __Pyx_memviewslice __pyx_v_work = { 0, 0, { 0 }, { 0 }, { 0 } };
24590 0 : __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
24591 0 : double __pyx_v_xval;
24592 0 : PyObject *__pyx_r = NULL;
24593 : __Pyx_RefNannyDeclarations
24594 0 : PyObject *__pyx_t_1 = NULL;
24595 0 : PyObject *__pyx_t_2 = NULL;
24596 0 : PyObject *__pyx_t_3 = NULL;
24597 0 : PyObject *__pyx_t_4 = NULL;
24598 0 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
24599 0 : npy_intp __pyx_t_6;
24600 0 : npy_intp __pyx_t_7;
24601 0 : npy_intp __pyx_t_8;
24602 0 : Py_ssize_t __pyx_t_9;
24603 0 : Py_ssize_t __pyx_t_10;
24604 0 : long __pyx_t_11;
24605 0 : long __pyx_t_12;
24606 0 : npy_intp __pyx_t_13;
24607 0 : unsigned int __pyx_t_14;
24608 0 : PyObject *__pyx_t_15 = NULL;
24609 0 : int __pyx_lineno = 0;
24610 0 : const char *__pyx_filename = NULL;
24611 0 : int __pyx_clineno = 0;
24612 0 : __Pyx_RefNannySetupContext("__pyx_fuse_1_make_design_matrix", 1);
24613 :
24614 : /* "scipy/interpolate/_bspl.pyx":421
24615 : * cdef:
24616 : * cnp.npy_intp i, j, m, ind
24617 : * cnp.npy_intp n = x.shape[0] # <<<<<<<<<<<<<<
24618 : * double[::1] work = np.empty(2*k+2, dtype=float)
24619 : * double[::1] data = np.zeros(n * (k + 1), dtype=float)
24620 : */
24621 0 : __pyx_v_n = (__pyx_v_x.shape[0]);
24622 :
24623 : /* "scipy/interpolate/_bspl.pyx":422
24624 : * cnp.npy_intp i, j, m, ind
24625 : * cnp.npy_intp n = x.shape[0]
24626 : * double[::1] work = np.empty(2*k+2, dtype=float) # <<<<<<<<<<<<<<
24627 : * double[::1] data = np.zeros(n * (k + 1), dtype=float)
24628 : * double xval
24629 : */
24630 0 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
24631 0 : __Pyx_GOTREF(__pyx_t_1);
24632 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
24633 0 : __Pyx_GOTREF(__pyx_t_2);
24634 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24635 0 : __pyx_t_1 = __Pyx_PyInt_From_long(((2 * __pyx_v_k) + 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
24636 0 : __Pyx_GOTREF(__pyx_t_1);
24637 0 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
24638 0 : __Pyx_GOTREF(__pyx_t_3);
24639 0 : __Pyx_GIVEREF(__pyx_t_1);
24640 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error);
24641 0 : __pyx_t_1 = 0;
24642 0 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error)
24643 0 : __Pyx_GOTREF(__pyx_t_1);
24644 0 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 422, __pyx_L1_error)
24645 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
24646 0 : __Pyx_GOTREF(__pyx_t_4);
24647 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24648 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24649 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24650 0 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 422, __pyx_L1_error)
24651 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24652 0 : __pyx_v_work = __pyx_t_5;
24653 0 : __pyx_t_5.memview = NULL;
24654 0 : __pyx_t_5.data = NULL;
24655 :
24656 : /* "scipy/interpolate/_bspl.pyx":423
24657 : * cnp.npy_intp n = x.shape[0]
24658 : * double[::1] work = np.empty(2*k+2, dtype=float)
24659 : * double[::1] data = np.zeros(n * (k + 1), dtype=float) # <<<<<<<<<<<<<<
24660 : * double xval
24661 : * ind = k
24662 : */
24663 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
24664 0 : __Pyx_GOTREF(__pyx_t_4);
24665 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
24666 0 : __Pyx_GOTREF(__pyx_t_1);
24667 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24668 0 : __pyx_t_4 = __Pyx_PyInt_From_npy_intp((__pyx_v_n * (__pyx_v_k + 1))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
24669 0 : __Pyx_GOTREF(__pyx_t_4);
24670 0 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error)
24671 0 : __Pyx_GOTREF(__pyx_t_3);
24672 0 : __Pyx_GIVEREF(__pyx_t_4);
24673 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error);
24674 0 : __pyx_t_4 = 0;
24675 0 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
24676 0 : __Pyx_GOTREF(__pyx_t_4);
24677 0 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
24678 0 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
24679 0 : __Pyx_GOTREF(__pyx_t_2);
24680 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24681 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24682 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24683 0 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 423, __pyx_L1_error)
24684 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24685 0 : __pyx_v_data = __pyx_t_5;
24686 0 : __pyx_t_5.memview = NULL;
24687 0 : __pyx_t_5.data = NULL;
24688 :
24689 : /* "scipy/interpolate/_bspl.pyx":425
24690 : * double[::1] data = np.zeros(n * (k + 1), dtype=float)
24691 : * double xval
24692 : * ind = k # <<<<<<<<<<<<<<
24693 : * for i in range(n):
24694 : * xval = x[i]
24695 : */
24696 0 : __pyx_v_ind = __pyx_v_k;
24697 :
24698 : /* "scipy/interpolate/_bspl.pyx":426
24699 : * double xval
24700 : * ind = k
24701 : * for i in range(n): # <<<<<<<<<<<<<<
24702 : * xval = x[i]
24703 : *
24704 : */
24705 0 : __pyx_t_6 = __pyx_v_n;
24706 0 : __pyx_t_7 = __pyx_t_6;
24707 0 : for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
24708 0 : __pyx_v_i = __pyx_t_8;
24709 :
24710 : /* "scipy/interpolate/_bspl.pyx":427
24711 : * ind = k
24712 : * for i in range(n):
24713 : * xval = x[i] # <<<<<<<<<<<<<<
24714 : *
24715 : * # Find correct interval. Note that interval >= 0 always as
24716 : */
24717 0 : __pyx_t_9 = __pyx_v_i;
24718 0 : __pyx_v_xval = (*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_x.data) + __pyx_t_9)) )));
24719 :
24720 : /* "scipy/interpolate/_bspl.pyx":432
24721 : * # extrapolate=False and out of bound values are already dealt with in
24722 : * # design_matrix
24723 : * ind = find_interval(t, k, xval, ind, extrapolate) # <<<<<<<<<<<<<<
24724 : * _deBoor_D(&t[0], xval, k, ind, 0, &work[0])
24725 : *
24726 : */
24727 0 : __pyx_v_ind = __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__pyx_v_t, __pyx_v_k, __pyx_v_xval, __pyx_v_ind, __pyx_v_extrapolate);
24728 :
24729 : /* "scipy/interpolate/_bspl.pyx":433
24730 : * # design_matrix
24731 : * ind = find_interval(t, k, xval, ind, extrapolate)
24732 : * _deBoor_D(&t[0], xval, k, ind, 0, &work[0]) # <<<<<<<<<<<<<<
24733 : *
24734 : * # data[(k + 1) * i : (k + 1) * (i + 1)] = work[:k + 1]
24735 : */
24736 0 : __pyx_t_9 = 0;
24737 0 : __pyx_t_10 = 0;
24738 0 : fitpack::_deBoor_D((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_9)) )))), __pyx_v_xval, __pyx_v_k, __pyx_v_ind, 0, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_work.data) + __pyx_t_10)) )))));
24739 :
24740 : /* "scipy/interpolate/_bspl.pyx":437
24741 : * # data[(k + 1) * i : (k + 1) * (i + 1)] = work[:k + 1]
24742 : * # indices[(k + 1) * i : (k + 1) * (i + 1)] = np.arange(ind - k, ind + 1)
24743 : * for j in range(k + 1): # <<<<<<<<<<<<<<
24744 : * m = (k + 1) * i + j
24745 : * data[m] = work[j]
24746 : */
24747 : __pyx_t_11 = (__pyx_v_k + 1);
24748 : __pyx_t_12 = __pyx_t_11;
24749 0 : for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_12; __pyx_t_13+=1) {
24750 0 : __pyx_v_j = __pyx_t_13;
24751 :
24752 : /* "scipy/interpolate/_bspl.pyx":438
24753 : * # indices[(k + 1) * i : (k + 1) * (i + 1)] = np.arange(ind - k, ind + 1)
24754 : * for j in range(k + 1):
24755 : * m = (k + 1) * i + j # <<<<<<<<<<<<<<
24756 : * data[m] = work[j]
24757 : * indices[m] = ind - k + j
24758 : */
24759 0 : __pyx_v_m = (((__pyx_v_k + 1) * __pyx_v_i) + __pyx_v_j);
24760 :
24761 : /* "scipy/interpolate/_bspl.pyx":439
24762 : * for j in range(k + 1):
24763 : * m = (k + 1) * i + j
24764 : * data[m] = work[j] # <<<<<<<<<<<<<<
24765 : * indices[m] = ind - k + j
24766 : *
24767 : */
24768 0 : __pyx_t_10 = __pyx_v_j;
24769 0 : __pyx_t_9 = __pyx_v_m;
24770 0 : *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_9)) )) = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_work.data) + __pyx_t_10)) )));
24771 :
24772 : /* "scipy/interpolate/_bspl.pyx":440
24773 : * m = (k + 1) * i + j
24774 : * data[m] = work[j]
24775 : * indices[m] = ind - k + j # <<<<<<<<<<<<<<
24776 : *
24777 : * return np.asarray(data), np.asarray(indices)
24778 : */
24779 0 : __pyx_t_10 = __pyx_v_m;
24780 0 : *((npy_int64 *) ( /* dim=0 */ ((char *) (((npy_int64 *) __pyx_v_indices.data) + __pyx_t_10)) )) = ((__pyx_v_ind - __pyx_v_k) + __pyx_v_j);
24781 : }
24782 : }
24783 :
24784 : /* "scipy/interpolate/_bspl.pyx":442
24785 : * indices[m] = ind - k + j
24786 : *
24787 : * return np.asarray(data), np.asarray(indices) # <<<<<<<<<<<<<<
24788 : *
24789 : *
24790 : */
24791 0 : __Pyx_XDECREF(__pyx_r);
24792 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
24793 0 : __Pyx_GOTREF(__pyx_t_4);
24794 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
24795 0 : __Pyx_GOTREF(__pyx_t_3);
24796 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24797 0 : __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
24798 0 : __Pyx_GOTREF(__pyx_t_4);
24799 0 : __pyx_t_1 = NULL;
24800 0 : __pyx_t_14 = 0;
24801 : #if CYTHON_UNPACK_METHODS
24802 0 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
24803 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
24804 0 : if (likely(__pyx_t_1)) {
24805 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
24806 0 : __Pyx_INCREF(__pyx_t_1);
24807 0 : __Pyx_INCREF(function);
24808 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
24809 : __pyx_t_14 = 1;
24810 : }
24811 : }
24812 : #endif
24813 0 : {
24814 0 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_4};
24815 0 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
24816 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24817 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24818 0 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error)
24819 0 : __Pyx_GOTREF(__pyx_t_2);
24820 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24821 : }
24822 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
24823 0 : __Pyx_GOTREF(__pyx_t_4);
24824 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
24825 0 : __Pyx_GOTREF(__pyx_t_1);
24826 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24827 0 : __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_indices, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_npy_int64, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_npy_int64, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
24828 0 : __Pyx_GOTREF(__pyx_t_4);
24829 0 : __pyx_t_15 = NULL;
24830 0 : __pyx_t_14 = 0;
24831 : #if CYTHON_UNPACK_METHODS
24832 0 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
24833 0 : __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_1);
24834 0 : if (likely(__pyx_t_15)) {
24835 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
24836 0 : __Pyx_INCREF(__pyx_t_15);
24837 0 : __Pyx_INCREF(function);
24838 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
24839 : __pyx_t_14 = 1;
24840 : }
24841 : }
24842 : #endif
24843 0 : {
24844 0 : PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_4};
24845 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
24846 0 : __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
24847 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24848 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
24849 0 : __Pyx_GOTREF(__pyx_t_3);
24850 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24851 : }
24852 0 : __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
24853 0 : __Pyx_GOTREF(__pyx_t_1);
24854 0 : __Pyx_GIVEREF(__pyx_t_2);
24855 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error);
24856 0 : __Pyx_GIVEREF(__pyx_t_3);
24857 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error);
24858 0 : __pyx_t_2 = 0;
24859 0 : __pyx_t_3 = 0;
24860 0 : __pyx_r = __pyx_t_1;
24861 0 : __pyx_t_1 = 0;
24862 0 : goto __pyx_L0;
24863 :
24864 : /* "scipy/interpolate/_bspl.pyx":383
24865 : * rhs[row, ci] = rhs[row, ci] + wrk[r] * y[j, ci] * wval
24866 : *
24867 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
24868 : * @cython.boundscheck(False)
24869 : * def _make_design_matrix(const double[::1] x,
24870 : */
24871 :
24872 : /* function exit code */
24873 0 : __pyx_L1_error:;
24874 0 : __Pyx_XDECREF(__pyx_t_1);
24875 0 : __Pyx_XDECREF(__pyx_t_2);
24876 0 : __Pyx_XDECREF(__pyx_t_3);
24877 0 : __Pyx_XDECREF(__pyx_t_4);
24878 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
24879 0 : __Pyx_XDECREF(__pyx_t_15);
24880 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._make_design_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
24881 : __pyx_r = NULL;
24882 0 : __pyx_L0:;
24883 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_work, 1);
24884 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_data, 1);
24885 0 : __Pyx_XGIVEREF(__pyx_r);
24886 0 : __Pyx_RefNannyFinishContext();
24887 0 : return __pyx_r;
24888 : }
24889 :
24890 : /* "scipy/interpolate/_bspl.pyx":446
24891 : *
24892 : *
24893 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
24894 : * @cython.boundscheck(False)
24895 : * @cython.nonecheck(False)
24896 : */
24897 :
24898 : /* Python wrapper */
24899 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_13evaluate_ndbspline(PyObject *__pyx_self,
24900 : #if CYTHON_METH_FASTCALL
24901 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24902 : #else
24903 : PyObject *__pyx_args, PyObject *__pyx_kwds
24904 : #endif
24905 : ); /*proto*/
24906 : PyDoc_STRVAR(__pyx_doc_5scipy_11interpolate_5_bspl_12evaluate_ndbspline, "Evaluate an N-dim tensor product spline or its derivative.\n\n Parameters\n ----------\n xi : ndarray, shape(npoints, ndim)\n ``npoints`` values to evaluate the spline at, each value is\n a point in an ``ndim``-dimensional space.\n t : ndarray, shape(ndim, max_len_t)\n Array of knots for each dimension.\n This array packs the tuple of knot arrays per dimension into a single\n 2D array. The array is ragged (knot lengths may differ), hence\n the real knots in dimension ``d`` are ``t[d, :len_t[d]]``.\n len_t : ndarray, 1D, shape (ndim,)\n Lengths of the knot arrays, per dimension.\n k : tuple of ints, len(ndim)\n Spline degrees in each dimension.\n nu : ndarray of ints, shape(ndim,)\n Orders of derivatives to compute, per dimension.\n extrapolate : int\n Whether to extrapolate out of bounds or return nans.\n c1r: ndarray, one-dimensional\n Flattened array of coefficients.\n The original N-dimensional coefficient array ``c`` has shape\n ``(n1, ..., nd, ...)`` where each ``ni == len(t[d]) - k[d] - 1``,\n and the second \"...\" represents trailing dimensions of ``c``.\n In code, given the C-ordered array ``c``, ``c1r`` is\n ``c1 = c.reshape(c.shape[:ndim] + (-1,)); c1r = c1.ravel()``\n num_c_tr : int\n The number of elements of ``c1r``, which correspond to the trailing\n dimensions of ``c``. In code, this is\n ``c1 = c.reshape(c.shape[:ndim] + (-1,)); num_c_tr = c1.shape[-1]``.\n strides_c1 : ndarray, one-dimensional\n Pre-computed strides of the ``c1`` array.\n Note: These are *data* strides, not numpy-style byte strides.\n This array is equivalent to\n ``[stride // s1.dtype.itemsize for stride in s1.strides]``.\n indices_k1d : ndarray, sha""pe((k+1)**ndim, ndim)\n Pre-computed mapping between indices for iterating over a flattened\n array of shape ``[k[d] + 1) for d in range(ndim)`` and\n ndim-dimensional indices of the ``(k+1,)*ndim`` dimensional array.\n This is essentially a transposed version of\n ``np.unravel_index(np.arange((k+1)**ndim), (k+1,)*ndim)``.\n out : ndarray, shape (npoints, num_c_tr)\n Output values of the b-spline at given ``xi`` points.\n\n Notes\n -----\n\n This function is essentially equivalent to the following: given an\n N-dimensional vector ``x = (x1, x2, ..., xN)``, iterate over the\n dimensions, form linear combinations of products,\n B(x1) * B(x2) * ... B(xN) of (k+1)**N b-splines which are non-zero\n at ``x``.\n\n Since b-splines are localized, the sum has (k+1)**N non-zero elements.\n\n If ``i = (i1, i2, ..., iN)`` is a vector if intervals of the knot\n vectors, ``t[d, id] <= xd < t[d, id+1]``, for ``d=1, 2, ..., N``, then\n the core loop of this function is nothing but\n\n ```\n result = 0\n iters = [range(i[d] - self.k[d], i[d] + 1) for d in range(ndim)]\n for idx in itertools.product(*iters):\n term = self.c[idx] * np.prod([B(x[d], self.k[d], idx[d], self.t[d])\n for d in range(ndim)])\n result += term\n ```\n\n For efficiency reasons, we iterate over the flattened versions of the\n arrays.\n\n ");
24907 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_13evaluate_ndbspline = {"evaluate_ndbspline", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_13evaluate_ndbspline, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_12evaluate_ndbspline};
24908 201 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_13evaluate_ndbspline(PyObject *__pyx_self,
24909 : #if CYTHON_METH_FASTCALL
24910 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
24911 : #else
24912 : PyObject *__pyx_args, PyObject *__pyx_kwds
24913 : #endif
24914 : ) {
24915 201 : __Pyx_memviewslice __pyx_v_xi = { 0, 0, { 0 }, { 0 }, { 0 } };
24916 201 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
24917 201 : __Pyx_memviewslice __pyx_v_len_t = { 0, 0, { 0 }, { 0 }, { 0 } };
24918 201 : __Pyx_memviewslice __pyx_v_k = { 0, 0, { 0 }, { 0 }, { 0 } };
24919 201 : __Pyx_memviewslice __pyx_v_nu = { 0, 0, { 0 }, { 0 }, { 0 } };
24920 201 : int __pyx_v_extrapolate;
24921 201 : __Pyx_memviewslice __pyx_v_c1r = { 0, 0, { 0 }, { 0 }, { 0 } };
24922 201 : npy_intp __pyx_v_num_c_tr;
24923 201 : __Pyx_memviewslice __pyx_v_strides_c1 = { 0, 0, { 0 }, { 0 }, { 0 } };
24924 201 : __Pyx_memviewslice __pyx_v_indices_k1d = { 0, 0, { 0 }, { 0 }, { 0 } };
24925 201 : __Pyx_memviewslice __pyx_v_out = { 0, 0, { 0 }, { 0 }, { 0 } };
24926 : #if !CYTHON_METH_FASTCALL
24927 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
24928 : #endif
24929 201 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
24930 201 : PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
24931 201 : int __pyx_lineno = 0;
24932 201 : const char *__pyx_filename = NULL;
24933 201 : int __pyx_clineno = 0;
24934 201 : PyObject *__pyx_r = 0;
24935 : __Pyx_RefNannyDeclarations
24936 201 : __Pyx_RefNannySetupContext("evaluate_ndbspline (wrapper)", 0);
24937 : #if !CYTHON_METH_FASTCALL
24938 : #if CYTHON_ASSUME_SAFE_MACROS
24939 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
24940 : #else
24941 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
24942 : #endif
24943 : #endif
24944 201 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
24945 201 : {
24946 201 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xi,&__pyx_n_s_t,&__pyx_n_s_len_t,&__pyx_n_s_k,&__pyx_n_s_nu,&__pyx_n_s_extrapolate,&__pyx_n_s_c1r,&__pyx_n_s_num_c_tr,&__pyx_n_s_strides_c1,&__pyx_n_s_indices_k1d,&__pyx_n_s_out,0};
24947 201 : if (__pyx_kwds) {
24948 0 : Py_ssize_t kw_args;
24949 0 : switch (__pyx_nargs) {
24950 0 : case 11: values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
24951 0 : CYTHON_FALLTHROUGH;
24952 0 : case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
24953 0 : CYTHON_FALLTHROUGH;
24954 0 : case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
24955 0 : CYTHON_FALLTHROUGH;
24956 0 : case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
24957 0 : CYTHON_FALLTHROUGH;
24958 0 : case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
24959 0 : CYTHON_FALLTHROUGH;
24960 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
24961 0 : CYTHON_FALLTHROUGH;
24962 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
24963 0 : CYTHON_FALLTHROUGH;
24964 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
24965 0 : CYTHON_FALLTHROUGH;
24966 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
24967 0 : CYTHON_FALLTHROUGH;
24968 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
24969 0 : CYTHON_FALLTHROUGH;
24970 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
24971 0 : CYTHON_FALLTHROUGH;
24972 0 : case 0: break;
24973 0 : default: goto __pyx_L5_argtuple_error;
24974 : }
24975 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
24976 0 : switch (__pyx_nargs) {
24977 0 : case 0:
24978 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xi)) != 0)) {
24979 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
24980 0 : kw_args--;
24981 : }
24982 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
24983 0 : else goto __pyx_L5_argtuple_error;
24984 0 : CYTHON_FALLTHROUGH;
24985 0 : case 1:
24986 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
24987 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
24988 0 : kw_args--;
24989 : }
24990 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
24991 : else {
24992 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 1); __PYX_ERR(0, 446, __pyx_L3_error)
24993 : }
24994 0 : CYTHON_FALLTHROUGH;
24995 0 : case 2:
24996 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_len_t)) != 0)) {
24997 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
24998 0 : kw_args--;
24999 : }
25000 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25001 : else {
25002 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 2); __PYX_ERR(0, 446, __pyx_L3_error)
25003 : }
25004 0 : CYTHON_FALLTHROUGH;
25005 0 : case 3:
25006 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
25007 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
25008 0 : kw_args--;
25009 : }
25010 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25011 : else {
25012 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 3); __PYX_ERR(0, 446, __pyx_L3_error)
25013 : }
25014 0 : CYTHON_FALLTHROUGH;
25015 0 : case 4:
25016 0 : if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nu)) != 0)) {
25017 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
25018 0 : kw_args--;
25019 : }
25020 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25021 : else {
25022 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 4); __PYX_ERR(0, 446, __pyx_L3_error)
25023 : }
25024 0 : CYTHON_FALLTHROUGH;
25025 0 : case 5:
25026 0 : if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_extrapolate)) != 0)) {
25027 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[5]);
25028 0 : kw_args--;
25029 : }
25030 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25031 : else {
25032 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 5); __PYX_ERR(0, 446, __pyx_L3_error)
25033 : }
25034 0 : CYTHON_FALLTHROUGH;
25035 0 : case 6:
25036 0 : if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_c1r)) != 0)) {
25037 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[6]);
25038 0 : kw_args--;
25039 : }
25040 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25041 : else {
25042 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 6); __PYX_ERR(0, 446, __pyx_L3_error)
25043 : }
25044 0 : CYTHON_FALLTHROUGH;
25045 0 : case 7:
25046 0 : if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_num_c_tr)) != 0)) {
25047 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[7]);
25048 0 : kw_args--;
25049 : }
25050 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25051 : else {
25052 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 7); __PYX_ERR(0, 446, __pyx_L3_error)
25053 : }
25054 0 : CYTHON_FALLTHROUGH;
25055 0 : case 8:
25056 0 : if (likely((values[8] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_strides_c1)) != 0)) {
25057 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[8]);
25058 0 : kw_args--;
25059 : }
25060 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25061 : else {
25062 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 8); __PYX_ERR(0, 446, __pyx_L3_error)
25063 : }
25064 0 : CYTHON_FALLTHROUGH;
25065 0 : case 9:
25066 0 : if (likely((values[9] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices_k1d)) != 0)) {
25067 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[9]);
25068 0 : kw_args--;
25069 : }
25070 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25071 : else {
25072 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 9); __PYX_ERR(0, 446, __pyx_L3_error)
25073 : }
25074 0 : CYTHON_FALLTHROUGH;
25075 0 : case 10:
25076 0 : if (likely((values[10] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_out)) != 0)) {
25077 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[10]);
25078 0 : kw_args--;
25079 : }
25080 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
25081 : else {
25082 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, 10); __PYX_ERR(0, 446, __pyx_L3_error)
25083 : }
25084 : }
25085 0 : if (unlikely(kw_args > 0)) {
25086 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
25087 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "evaluate_ndbspline") < 0)) __PYX_ERR(0, 446, __pyx_L3_error)
25088 : }
25089 201 : } else if (unlikely(__pyx_nargs != 11)) {
25090 0 : goto __pyx_L5_argtuple_error;
25091 : } else {
25092 201 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
25093 201 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
25094 201 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
25095 201 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
25096 201 : values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
25097 201 : values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
25098 201 : values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
25099 201 : values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
25100 201 : values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8);
25101 201 : values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9);
25102 201 : values[10] = __Pyx_Arg_FASTCALL(__pyx_args, 10);
25103 : }
25104 201 : __pyx_v_xi = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_xi.memview)) __PYX_ERR(0, 449, __pyx_L3_error)
25105 201 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 450, __pyx_L3_error)
25106 201 : __pyx_v_len_t = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32__const__(values[2], 0); if (unlikely(!__pyx_v_len_t.memview)) __PYX_ERR(0, 451, __pyx_L3_error)
25107 201 : __pyx_v_k = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32__const__(values[3], 0); if (unlikely(!__pyx_v_k.memview)) __PYX_ERR(0, 452, __pyx_L3_error)
25108 201 : __pyx_v_nu = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[4], PyBUF_WRITABLE); if (unlikely(!__pyx_v_nu.memview)) __PYX_ERR(0, 453, __pyx_L3_error)
25109 201 : __pyx_v_extrapolate = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_extrapolate == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L3_error)
25110 201 : __pyx_v_c1r = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[6], 0); if (unlikely(!__pyx_v_c1r.memview)) __PYX_ERR(0, 455, __pyx_L3_error)
25111 201 : __pyx_v_num_c_tr = __Pyx_PyInt_As_npy_intp(values[7]); if (unlikely((__pyx_v_num_c_tr == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L3_error)
25112 201 : __pyx_v_strides_c1 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp__const__(values[8], 0); if (unlikely(!__pyx_v_strides_c1.memview)) __PYX_ERR(0, 457, __pyx_L3_error)
25113 201 : __pyx_v_indices_k1d = __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_npy_intp__const__(values[9], 0); if (unlikely(!__pyx_v_indices_k1d.memview)) __PYX_ERR(0, 458, __pyx_L3_error)
25114 201 : __pyx_v_out = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[10], PyBUF_WRITABLE); if (unlikely(!__pyx_v_out.memview)) __PYX_ERR(0, 459, __pyx_L3_error)
25115 : }
25116 201 : goto __pyx_L6_skip;
25117 0 : __pyx_L5_argtuple_error:;
25118 0 : __Pyx_RaiseArgtupleInvalid("evaluate_ndbspline", 1, 11, 11, __pyx_nargs); __PYX_ERR(0, 446, __pyx_L3_error)
25119 201 : __pyx_L6_skip:;
25120 201 : goto __pyx_L4_argument_unpacking_done;
25121 0 : __pyx_L3_error:;
25122 0 : {
25123 0 : Py_ssize_t __pyx_temp;
25124 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25125 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
25126 : }
25127 : }
25128 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xi, 1);
25129 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
25130 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_len_t, 1);
25131 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_k, 1);
25132 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_nu, 1);
25133 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_c1r, 1);
25134 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_strides_c1, 1);
25135 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_indices_k1d, 1);
25136 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_out, 1);
25137 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.evaluate_ndbspline", __pyx_clineno, __pyx_lineno, __pyx_filename);
25138 : __Pyx_RefNannyFinishContext();
25139 : return NULL;
25140 201 : __pyx_L4_argument_unpacking_done:;
25141 201 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_12evaluate_ndbspline(__pyx_self, __pyx_v_xi, __pyx_v_t, __pyx_v_len_t, __pyx_v_k, __pyx_v_nu, __pyx_v_extrapolate, __pyx_v_c1r, __pyx_v_num_c_tr, __pyx_v_strides_c1, __pyx_v_indices_k1d, __pyx_v_out);
25142 :
25143 : /* function exit code */
25144 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xi, 1);
25145 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
25146 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_len_t, 1);
25147 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_k, 1);
25148 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_nu, 1);
25149 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_c1r, 1);
25150 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_strides_c1, 1);
25151 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_indices_k1d, 1);
25152 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_out, 1);
25153 : {
25154 : Py_ssize_t __pyx_temp;
25155 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
25156 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
25157 : }
25158 : }
25159 : __Pyx_RefNannyFinishContext();
25160 : return __pyx_r;
25161 : }
25162 :
25163 201 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_12evaluate_ndbspline(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_xi, __Pyx_memviewslice __pyx_v_t, __Pyx_memviewslice __pyx_v_len_t, __Pyx_memviewslice __pyx_v_k, __Pyx_memviewslice __pyx_v_nu, int __pyx_v_extrapolate, __Pyx_memviewslice __pyx_v_c1r, npy_intp __pyx_v_num_c_tr, __Pyx_memviewslice __pyx_v_strides_c1, __Pyx_memviewslice __pyx_v_indices_k1d, __Pyx_memviewslice __pyx_v_out) {
25164 201 : npy_intp __pyx_v_ndim;
25165 201 : __Pyx_memviewslice __pyx_v_i = { 0, 0, { 0 }, { 0 }, { 0 } };
25166 201 : __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
25167 201 : __Pyx_memviewslice __pyx_v_xv = { 0, 0, { 0 }, { 0 }, { 0 } };
25168 201 : double __pyx_v_xd;
25169 201 : __Pyx_memviewslice __pyx_v_td = { 0, 0, { 0 }, { 0 }, { 0 } };
25170 201 : npy_intp __pyx_v_kd;
25171 201 : npy_intp __pyx_v_i_c;
25172 201 : npy_intp __pyx_v_iflat;
25173 201 : npy_intp __pyx_v_volume;
25174 201 : __Pyx_memviewslice __pyx_v_idx_b = { 0, 0, { 0 }, { 0 }, { 0 } };
25175 201 : int __pyx_v_out_of_bounds;
25176 201 : npy_intp __pyx_v_idx_cflat_base;
25177 201 : npy_intp __pyx_v_idx;
25178 201 : double __pyx_v_factor;
25179 201 : __Pyx_memviewslice __pyx_v_wrk = { 0, 0, { 0 }, { 0 }, { 0 } };
25180 201 : npy_intp __pyx_v_d;
25181 201 : Py_ssize_t __pyx_v_j;
25182 201 : PyObject *__pyx_r = NULL;
25183 : __Pyx_RefNannyDeclarations
25184 201 : Py_ssize_t __pyx_t_1;
25185 201 : PyObject *__pyx_t_2 = NULL;
25186 201 : PyObject *__pyx_t_3 = NULL;
25187 201 : PyObject *__pyx_t_4 = NULL;
25188 201 : PyObject *__pyx_t_5 = NULL;
25189 201 : PyObject *__pyx_t_6 = NULL;
25190 201 : __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
25191 201 : __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
25192 201 : __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
25193 201 : int __pyx_t_10;
25194 201 : Py_UCS4 __pyx_t_11;
25195 201 : npy_intp __pyx_t_12;
25196 201 : npy_intp __pyx_t_13;
25197 201 : npy_intp __pyx_t_14;
25198 201 : Py_ssize_t __pyx_t_15;
25199 201 : Py_ssize_t __pyx_t_16;
25200 201 : Py_ssize_t __pyx_t_17;
25201 201 : __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
25202 201 : __Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
25203 201 : int __pyx_t_20;
25204 201 : Py_ssize_t __pyx_t_21;
25205 201 : Py_ssize_t __pyx_t_22;
25206 201 : Py_ssize_t __pyx_t_23;
25207 201 : __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } };
25208 201 : __Pyx_memviewslice __pyx_t_25 = { 0, 0, { 0 }, { 0 }, { 0 } };
25209 201 : npy_intp __pyx_t_26;
25210 201 : npy_intp __pyx_t_27;
25211 201 : npy_intp __pyx_t_28;
25212 201 : Py_ssize_t __pyx_t_29;
25213 201 : int __pyx_lineno = 0;
25214 201 : const char *__pyx_filename = NULL;
25215 201 : int __pyx_clineno = 0;
25216 201 : __Pyx_RefNannySetupContext("evaluate_ndbspline", 1);
25217 :
25218 : /* "scipy/interpolate/_bspl.pyx":535
25219 : * """
25220 : * cdef:
25221 : * npy_intp ndim = len(t) # <<<<<<<<<<<<<<
25222 : *
25223 : * # 'intervals': indices for a point in xi into the knot arrays t
25224 : */
25225 201 : __pyx_t_1 = __Pyx_MemoryView_Len(__pyx_v_t);
25226 201 : __pyx_v_ndim = __pyx_t_1;
25227 :
25228 : /* "scipy/interpolate/_bspl.pyx":538
25229 : *
25230 : * # 'intervals': indices for a point in xi into the knot arrays t
25231 : * npy_intp[::1] i = np.empty(ndim, dtype=np.intp) # <<<<<<<<<<<<<<
25232 : *
25233 : * # container for non-zero b-splines at each point in xi
25234 : */
25235 201 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
25236 201 : __Pyx_GOTREF(__pyx_t_2);
25237 201 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
25238 201 : __Pyx_GOTREF(__pyx_t_3);
25239 201 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25240 201 : __pyx_t_2 = __Pyx_PyInt_From_npy_intp(__pyx_v_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
25241 201 : __Pyx_GOTREF(__pyx_t_2);
25242 201 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __pyx_L1_error)
25243 201 : __Pyx_GOTREF(__pyx_t_4);
25244 201 : __Pyx_GIVEREF(__pyx_t_2);
25245 201 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error);
25246 201 : __pyx_t_2 = 0;
25247 201 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
25248 201 : __Pyx_GOTREF(__pyx_t_2);
25249 201 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 538, __pyx_L1_error)
25250 201 : __Pyx_GOTREF(__pyx_t_5);
25251 201 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error)
25252 201 : __Pyx_GOTREF(__pyx_t_6);
25253 201 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25254 201 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 538, __pyx_L1_error)
25255 201 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25256 201 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 538, __pyx_L1_error)
25257 201 : __Pyx_GOTREF(__pyx_t_6);
25258 201 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25259 201 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25260 201 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25261 201 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 538, __pyx_L1_error)
25262 201 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25263 201 : __pyx_v_i = __pyx_t_7;
25264 201 : __pyx_t_7.memview = NULL;
25265 201 : __pyx_t_7.data = NULL;
25266 :
25267 : /* "scipy/interpolate/_bspl.pyx":541
25268 : *
25269 : * # container for non-zero b-splines at each point in xi
25270 : * double[:, ::1] b = np.empty((ndim, max(k) + 1), dtype=float) # <<<<<<<<<<<<<<
25271 : *
25272 : * const double[::1] xv # an ndim-dimensional input point
25273 : */
25274 201 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error)
25275 201 : __Pyx_GOTREF(__pyx_t_6);
25276 201 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
25277 201 : __Pyx_GOTREF(__pyx_t_2);
25278 201 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25279 201 : __pyx_t_6 = __Pyx_PyInt_From_npy_intp(__pyx_v_ndim); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error)
25280 201 : __Pyx_GOTREF(__pyx_t_6);
25281 201 : __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_k, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_npy_int32__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
25282 201 : __Pyx_GOTREF(__pyx_t_4);
25283 201 : __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
25284 201 : __Pyx_GOTREF(__pyx_t_3);
25285 201 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25286 201 : __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
25287 201 : __Pyx_GOTREF(__pyx_t_4);
25288 201 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25289 201 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
25290 201 : __Pyx_GOTREF(__pyx_t_3);
25291 201 : __Pyx_GIVEREF(__pyx_t_6);
25292 201 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error);
25293 201 : __Pyx_GIVEREF(__pyx_t_4);
25294 201 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error);
25295 201 : __pyx_t_6 = 0;
25296 201 : __pyx_t_4 = 0;
25297 201 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
25298 201 : __Pyx_GOTREF(__pyx_t_4);
25299 201 : __Pyx_GIVEREF(__pyx_t_3);
25300 201 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error);
25301 201 : __pyx_t_3 = 0;
25302 201 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
25303 201 : __Pyx_GOTREF(__pyx_t_3);
25304 201 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
25305 201 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 541, __pyx_L1_error)
25306 201 : __Pyx_GOTREF(__pyx_t_6);
25307 201 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25308 201 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25309 201 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25310 201 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 541, __pyx_L1_error)
25311 201 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25312 201 : __pyx_v_b = __pyx_t_8;
25313 201 : __pyx_t_8.memview = NULL;
25314 201 : __pyx_t_8.data = NULL;
25315 :
25316 : /* "scipy/interpolate/_bspl.pyx":558
25317 : * npy_intp idx_cflat_base, idx
25318 : * double factor
25319 : * double[::1] wrk = np.empty(2*max(k) + 2, dtype=float) # <<<<<<<<<<<<<<
25320 : *
25321 : * if xi.shape[1] != ndim:
25322 : */
25323 201 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
25324 201 : __Pyx_GOTREF(__pyx_t_6);
25325 201 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
25326 201 : __Pyx_GOTREF(__pyx_t_3);
25327 201 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25328 201 : __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_k, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_npy_int32__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
25329 201 : __Pyx_GOTREF(__pyx_t_6);
25330 201 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
25331 201 : __Pyx_GOTREF(__pyx_t_4);
25332 201 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25333 201 : __pyx_t_6 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_t_4, 2, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
25334 201 : __Pyx_GOTREF(__pyx_t_6);
25335 201 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25336 201 : __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
25337 201 : __Pyx_GOTREF(__pyx_t_4);
25338 201 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25339 201 : __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 558, __pyx_L1_error)
25340 201 : __Pyx_GOTREF(__pyx_t_6);
25341 201 : __Pyx_GIVEREF(__pyx_t_4);
25342 201 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error);
25343 201 : __pyx_t_4 = 0;
25344 201 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
25345 201 : __Pyx_GOTREF(__pyx_t_4);
25346 201 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
25347 201 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
25348 201 : __Pyx_GOTREF(__pyx_t_2);
25349 201 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25350 201 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25351 201 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25352 201 : __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 558, __pyx_L1_error)
25353 201 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25354 201 : __pyx_v_wrk = __pyx_t_9;
25355 201 : __pyx_t_9.memview = NULL;
25356 201 : __pyx_t_9.data = NULL;
25357 :
25358 : /* "scipy/interpolate/_bspl.pyx":560
25359 : * double[::1] wrk = np.empty(2*max(k) + 2, dtype=float)
25360 : *
25361 : * if xi.shape[1] != ndim: # <<<<<<<<<<<<<<
25362 : * raise ValueError(f"Expacted data points in {ndim}-D space, got"
25363 : * f" {xi.shape[1]}-D points.")
25364 : */
25365 201 : __pyx_t_10 = ((__pyx_v_xi.shape[1]) != __pyx_v_ndim);
25366 201 : if (unlikely(__pyx_t_10)) {
25367 :
25368 : /* "scipy/interpolate/_bspl.pyx":561
25369 : *
25370 : * if xi.shape[1] != ndim:
25371 : * raise ValueError(f"Expacted data points in {ndim}-D space, got" # <<<<<<<<<<<<<<
25372 : * f" {xi.shape[1]}-D points.")
25373 : *
25374 : */
25375 0 : __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
25376 0 : __Pyx_GOTREF(__pyx_t_2);
25377 0 : __pyx_t_1 = 0;
25378 0 : __pyx_t_11 = 127;
25379 0 : __Pyx_INCREF(__pyx_kp_u_Expacted_data_points_in);
25380 0 : __pyx_t_1 += 24;
25381 0 : __Pyx_GIVEREF(__pyx_kp_u_Expacted_data_points_in);
25382 0 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Expacted_data_points_in);
25383 0 : __pyx_t_4 = __Pyx_PyInt_From_npy_intp(__pyx_v_ndim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error)
25384 0 : __Pyx_GOTREF(__pyx_t_4);
25385 0 : __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error)
25386 0 : __Pyx_GOTREF(__pyx_t_6);
25387 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25388 0 : __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_11;
25389 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
25390 0 : __Pyx_GIVEREF(__pyx_t_6);
25391 0 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
25392 0 : __pyx_t_6 = 0;
25393 0 : __Pyx_INCREF(__pyx_kp_u_D_space_got);
25394 0 : __pyx_t_1 += 14;
25395 0 : __Pyx_GIVEREF(__pyx_kp_u_D_space_got);
25396 0 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_D_space_got);
25397 :
25398 : /* "scipy/interpolate/_bspl.pyx":562
25399 : * if xi.shape[1] != ndim:
25400 : * raise ValueError(f"Expacted data points in {ndim}-D space, got"
25401 : * f" {xi.shape[1]}-D points.") # <<<<<<<<<<<<<<
25402 : *
25403 : * if out.shape[0] != xi.shape[0]:
25404 : */
25405 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t((__pyx_v_xi.shape[1]), 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 562, __pyx_L1_error)
25406 0 : __Pyx_GOTREF(__pyx_t_6);
25407 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
25408 0 : __Pyx_GIVEREF(__pyx_t_6);
25409 0 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
25410 0 : __pyx_t_6 = 0;
25411 0 : __Pyx_INCREF(__pyx_kp_u_D_points);
25412 0 : __pyx_t_1 += 10;
25413 0 : __Pyx_GIVEREF(__pyx_kp_u_D_points);
25414 0 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u_D_points);
25415 :
25416 : /* "scipy/interpolate/_bspl.pyx":561
25417 : *
25418 : * if xi.shape[1] != ndim:
25419 : * raise ValueError(f"Expacted data points in {ndim}-D space, got" # <<<<<<<<<<<<<<
25420 : * f" {xi.shape[1]}-D points.")
25421 : *
25422 : */
25423 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error)
25424 0 : __Pyx_GOTREF(__pyx_t_6);
25425 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25426 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
25427 0 : __Pyx_GOTREF(__pyx_t_2);
25428 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25429 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
25430 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25431 0 : __PYX_ERR(0, 561, __pyx_L1_error)
25432 :
25433 : /* "scipy/interpolate/_bspl.pyx":560
25434 : * double[::1] wrk = np.empty(2*max(k) + 2, dtype=float)
25435 : *
25436 : * if xi.shape[1] != ndim: # <<<<<<<<<<<<<<
25437 : * raise ValueError(f"Expacted data points in {ndim}-D space, got"
25438 : * f" {xi.shape[1]}-D points.")
25439 : */
25440 : }
25441 :
25442 : /* "scipy/interpolate/_bspl.pyx":564
25443 : * f" {xi.shape[1]}-D points.")
25444 : *
25445 : * if out.shape[0] != xi.shape[0]: # <<<<<<<<<<<<<<
25446 : * raise ValueError(f"out and xi are inconsistent: expected"
25447 : * f" {xi.shape[0]} output values, got"
25448 : */
25449 201 : __pyx_t_10 = ((__pyx_v_out.shape[0]) != (__pyx_v_xi.shape[0]));
25450 201 : if (unlikely(__pyx_t_10)) {
25451 :
25452 : /* "scipy/interpolate/_bspl.pyx":565
25453 : *
25454 : * if out.shape[0] != xi.shape[0]:
25455 : * raise ValueError(f"out and xi are inconsistent: expected" # <<<<<<<<<<<<<<
25456 : * f" {xi.shape[0]} output values, got"
25457 : * f" {out.shape[0]}.")
25458 : */
25459 0 : __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
25460 0 : __Pyx_GOTREF(__pyx_t_2);
25461 0 : __pyx_t_1 = 0;
25462 0 : __pyx_t_11 = 127;
25463 0 : __Pyx_INCREF(__pyx_kp_u_out_and_xi_are_inconsistent_expe);
25464 0 : __pyx_t_1 += 38;
25465 0 : __Pyx_GIVEREF(__pyx_kp_u_out_and_xi_are_inconsistent_expe);
25466 0 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_out_and_xi_are_inconsistent_expe);
25467 :
25468 : /* "scipy/interpolate/_bspl.pyx":566
25469 : * if out.shape[0] != xi.shape[0]:
25470 : * raise ValueError(f"out and xi are inconsistent: expected"
25471 : * f" {xi.shape[0]} output values, got" # <<<<<<<<<<<<<<
25472 : * f" {out.shape[0]}.")
25473 : * if out.shape[1] != num_c_tr:
25474 : */
25475 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t((__pyx_v_xi.shape[0]), 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error)
25476 0 : __Pyx_GOTREF(__pyx_t_6);
25477 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
25478 0 : __Pyx_GIVEREF(__pyx_t_6);
25479 0 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
25480 0 : __pyx_t_6 = 0;
25481 0 : __Pyx_INCREF(__pyx_kp_u_output_values_got);
25482 0 : __pyx_t_1 += 20;
25483 0 : __Pyx_GIVEREF(__pyx_kp_u_output_values_got);
25484 0 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_output_values_got);
25485 :
25486 : /* "scipy/interpolate/_bspl.pyx":567
25487 : * raise ValueError(f"out and xi are inconsistent: expected"
25488 : * f" {xi.shape[0]} output values, got"
25489 : * f" {out.shape[0]}.") # <<<<<<<<<<<<<<
25490 : * if out.shape[1] != num_c_tr:
25491 : * raise ValueError(f"out and c are inconsistent: num_c={num_c_tr} "
25492 : */
25493 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t((__pyx_v_out.shape[0]), 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
25494 0 : __Pyx_GOTREF(__pyx_t_6);
25495 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
25496 0 : __Pyx_GIVEREF(__pyx_t_6);
25497 0 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
25498 0 : __pyx_t_6 = 0;
25499 0 : __Pyx_INCREF(__pyx_kp_u__2);
25500 0 : __pyx_t_1 += 1;
25501 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
25502 0 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__2);
25503 :
25504 : /* "scipy/interpolate/_bspl.pyx":565
25505 : *
25506 : * if out.shape[0] != xi.shape[0]:
25507 : * raise ValueError(f"out and xi are inconsistent: expected" # <<<<<<<<<<<<<<
25508 : * f" {xi.shape[0]} output values, got"
25509 : * f" {out.shape[0]}.")
25510 : */
25511 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 565, __pyx_L1_error)
25512 0 : __Pyx_GOTREF(__pyx_t_6);
25513 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25514 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
25515 0 : __Pyx_GOTREF(__pyx_t_2);
25516 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25517 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
25518 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25519 0 : __PYX_ERR(0, 565, __pyx_L1_error)
25520 :
25521 : /* "scipy/interpolate/_bspl.pyx":564
25522 : * f" {xi.shape[1]}-D points.")
25523 : *
25524 : * if out.shape[0] != xi.shape[0]: # <<<<<<<<<<<<<<
25525 : * raise ValueError(f"out and xi are inconsistent: expected"
25526 : * f" {xi.shape[0]} output values, got"
25527 : */
25528 : }
25529 :
25530 : /* "scipy/interpolate/_bspl.pyx":568
25531 : * f" {xi.shape[0]} output values, got"
25532 : * f" {out.shape[0]}.")
25533 : * if out.shape[1] != num_c_tr: # <<<<<<<<<<<<<<
25534 : * raise ValueError(f"out and c are inconsistent: num_c={num_c_tr} "
25535 : * f" and out.shape[1] = {out.shape[1]}.")
25536 : */
25537 201 : __pyx_t_10 = ((__pyx_v_out.shape[1]) != __pyx_v_num_c_tr);
25538 201 : if (unlikely(__pyx_t_10)) {
25539 :
25540 : /* "scipy/interpolate/_bspl.pyx":569
25541 : * f" {out.shape[0]}.")
25542 : * if out.shape[1] != num_c_tr:
25543 : * raise ValueError(f"out and c are inconsistent: num_c={num_c_tr} " # <<<<<<<<<<<<<<
25544 : * f" and out.shape[1] = {out.shape[1]}.")
25545 : *
25546 : */
25547 0 : __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
25548 0 : __Pyx_GOTREF(__pyx_t_2);
25549 0 : __pyx_t_1 = 0;
25550 0 : __pyx_t_11 = 127;
25551 0 : __Pyx_INCREF(__pyx_kp_u_out_and_c_are_inconsistent_num_c);
25552 0 : __pyx_t_1 += 34;
25553 0 : __Pyx_GIVEREF(__pyx_kp_u_out_and_c_are_inconsistent_num_c);
25554 0 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_out_and_c_are_inconsistent_num_c);
25555 0 : __pyx_t_6 = __Pyx_PyInt_From_npy_intp(__pyx_v_num_c_tr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 569, __pyx_L1_error)
25556 0 : __Pyx_GOTREF(__pyx_t_6);
25557 0 : __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error)
25558 0 : __Pyx_GOTREF(__pyx_t_4);
25559 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25560 0 : __pyx_t_11 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_11) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_11;
25561 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
25562 0 : __Pyx_GIVEREF(__pyx_t_4);
25563 0 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
25564 0 : __pyx_t_4 = 0;
25565 0 : __Pyx_INCREF(__pyx_kp_u_and_out_shape_1);
25566 0 : __pyx_t_1 += 21;
25567 0 : __Pyx_GIVEREF(__pyx_kp_u_and_out_shape_1);
25568 0 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_and_out_shape_1);
25569 :
25570 : /* "scipy/interpolate/_bspl.pyx":570
25571 : * if out.shape[1] != num_c_tr:
25572 : * raise ValueError(f"out and c are inconsistent: num_c={num_c_tr} "
25573 : * f" and out.shape[1] = {out.shape[1]}.") # <<<<<<<<<<<<<<
25574 : *
25575 : *
25576 : */
25577 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t((__pyx_v_out.shape[1]), 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
25578 0 : __Pyx_GOTREF(__pyx_t_4);
25579 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
25580 0 : __Pyx_GIVEREF(__pyx_t_4);
25581 0 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_4);
25582 0 : __pyx_t_4 = 0;
25583 0 : __Pyx_INCREF(__pyx_kp_u__2);
25584 0 : __pyx_t_1 += 1;
25585 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
25586 0 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__2);
25587 :
25588 : /* "scipy/interpolate/_bspl.pyx":569
25589 : * f" {out.shape[0]}.")
25590 : * if out.shape[1] != num_c_tr:
25591 : * raise ValueError(f"out and c are inconsistent: num_c={num_c_tr} " # <<<<<<<<<<<<<<
25592 : * f" and out.shape[1] = {out.shape[1]}.")
25593 : *
25594 : */
25595 0 : __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error)
25596 0 : __Pyx_GOTREF(__pyx_t_4);
25597 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25598 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
25599 0 : __Pyx_GOTREF(__pyx_t_2);
25600 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25601 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
25602 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25603 0 : __PYX_ERR(0, 569, __pyx_L1_error)
25604 :
25605 : /* "scipy/interpolate/_bspl.pyx":568
25606 : * f" {xi.shape[0]} output values, got"
25607 : * f" {out.shape[0]}.")
25608 : * if out.shape[1] != num_c_tr: # <<<<<<<<<<<<<<
25609 : * raise ValueError(f"out and c are inconsistent: num_c={num_c_tr} "
25610 : * f" and out.shape[1] = {out.shape[1]}.")
25611 : */
25612 : }
25613 :
25614 : /* "scipy/interpolate/_bspl.pyx":573
25615 : *
25616 : *
25617 : * with nogil: # <<<<<<<<<<<<<<
25618 : * # the number of non-zero terms for each point in ``xi``.
25619 : * volume = 1
25620 : */
25621 201 : {
25622 : #ifdef WITH_THREAD
25623 201 : PyThreadState *_save;
25624 201 : _save = NULL;
25625 201 : Py_UNBLOCK_THREADS
25626 : __Pyx_FastGIL_Remember();
25627 : #endif
25628 : /*try:*/ {
25629 :
25630 : /* "scipy/interpolate/_bspl.pyx":575
25631 : * with nogil:
25632 : * # the number of non-zero terms for each point in ``xi``.
25633 : * volume = 1 # <<<<<<<<<<<<<<
25634 : * for d in range(ndim):
25635 : * volume *= k[d] + 1
25636 : */
25637 : __pyx_v_volume = 1;
25638 :
25639 : /* "scipy/interpolate/_bspl.pyx":576
25640 : * # the number of non-zero terms for each point in ``xi``.
25641 : * volume = 1
25642 : * for d in range(ndim): # <<<<<<<<<<<<<<
25643 : * volume *= k[d] + 1
25644 : *
25645 : */
25646 812 : __pyx_t_12 = __pyx_v_ndim;
25647 812 : __pyx_t_13 = __pyx_t_12;
25648 812 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
25649 611 : __pyx_v_d = __pyx_t_14;
25650 :
25651 : /* "scipy/interpolate/_bspl.pyx":577
25652 : * volume = 1
25653 : * for d in range(ndim):
25654 : * volume *= k[d] + 1 # <<<<<<<<<<<<<<
25655 : *
25656 : * ### Iterate over the data points
25657 : */
25658 611 : __pyx_t_15 = __pyx_v_d;
25659 611 : __pyx_v_volume = (__pyx_v_volume * ((*((npy_int32 const *) ( /* dim=0 */ ((char *) (((npy_int32 const *) __pyx_v_k.data) + __pyx_t_15)) ))) + 1));
25660 : }
25661 :
25662 : /* "scipy/interpolate/_bspl.pyx":580
25663 : *
25664 : * ### Iterate over the data points
25665 : * for j in range(xi.shape[0]): # <<<<<<<<<<<<<<
25666 : * xv = xi[j, :]
25667 : *
25668 : */
25669 2064 : __pyx_t_1 = (__pyx_v_xi.shape[0]);
25670 : __pyx_t_16 = __pyx_t_1;
25671 2064 : for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
25672 1863 : __pyx_v_j = __pyx_t_17;
25673 :
25674 : /* "scipy/interpolate/_bspl.pyx":581
25675 : * ### Iterate over the data points
25676 : * for j in range(xi.shape[0]):
25677 : * xv = xi[j, :] # <<<<<<<<<<<<<<
25678 : *
25679 : * # For each point, iterate over the dimensions
25680 : */
25681 1863 : __pyx_t_18.data = __pyx_v_xi.data;
25682 1863 : __pyx_t_18.memview = __pyx_v_xi.memview;
25683 1863 : __PYX_INC_MEMVIEW(&__pyx_t_18, 0);
25684 1863 : {
25685 1863 : Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
25686 1863 : Py_ssize_t __pyx_tmp_stride = __pyx_v_xi.strides[0];
25687 1863 : __pyx_t_18.data += __pyx_tmp_idx * __pyx_tmp_stride;
25688 : }
25689 :
25690 1863 : __pyx_t_18.shape[0] = __pyx_v_xi.shape[1];
25691 1863 : __pyx_t_18.strides[0] = __pyx_v_xi.strides[1];
25692 1863 : __pyx_t_18.suboffsets[0] = -1;
25693 :
25694 1863 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xv, 0);
25695 1863 : __pyx_v_xv = __pyx_t_18;
25696 1863 : __pyx_t_18.memview = NULL;
25697 1863 : __pyx_t_18.data = NULL;
25698 :
25699 : /* "scipy/interpolate/_bspl.pyx":584
25700 : *
25701 : * # For each point, iterate over the dimensions
25702 : * out_of_bounds = 0 # <<<<<<<<<<<<<<
25703 : * for d in range(ndim):
25704 : * td = t[d, :len_t[d]]
25705 : */
25706 1863 : __pyx_v_out_of_bounds = 0;
25707 :
25708 : /* "scipy/interpolate/_bspl.pyx":585
25709 : * # For each point, iterate over the dimensions
25710 : * out_of_bounds = 0
25711 : * for d in range(ndim): # <<<<<<<<<<<<<<
25712 : * td = t[d, :len_t[d]]
25713 : * xd = xv[d]
25714 : */
25715 1863 : __pyx_t_12 = __pyx_v_ndim;
25716 1863 : __pyx_t_13 = __pyx_t_12;
25717 7443 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
25718 5586 : __pyx_v_d = __pyx_t_14;
25719 :
25720 : /* "scipy/interpolate/_bspl.pyx":586
25721 : * out_of_bounds = 0
25722 : * for d in range(ndim):
25723 : * td = t[d, :len_t[d]] # <<<<<<<<<<<<<<
25724 : * xd = xv[d]
25725 : * kd = k[d]
25726 : */
25727 5586 : __pyx_t_15 = __pyx_v_d;
25728 5586 : __pyx_t_19.data = __pyx_v_t.data;
25729 5586 : __pyx_t_19.memview = __pyx_v_t.memview;
25730 5586 : __PYX_INC_MEMVIEW(&__pyx_t_19, 0);
25731 5586 : {
25732 5586 : Py_ssize_t __pyx_tmp_idx = __pyx_v_d;
25733 5586 : Py_ssize_t __pyx_tmp_stride = __pyx_v_t.strides[0];
25734 5586 : __pyx_t_19.data += __pyx_tmp_idx * __pyx_tmp_stride;
25735 : }
25736 :
25737 5586 : __pyx_t_20 = -1;
25738 5586 : if (unlikely(__pyx_memoryview_slice_memviewslice(
25739 : &__pyx_t_19,
25740 : __pyx_v_t.shape[1], __pyx_v_t.strides[1], __pyx_v_t.suboffsets[1],
25741 : 1,
25742 : 0,
25743 : &__pyx_t_20,
25744 : 0,
25745 : (*((npy_int32 const *) ( /* dim=0 */ ((char *) (((npy_int32 const *) __pyx_v_len_t.data) + __pyx_t_15)) ))),
25746 : 0,
25747 : 0,
25748 : 1,
25749 : 0,
25750 : 1) < 0))
25751 : {
25752 0 : __PYX_ERR(0, 586, __pyx_L7_error)
25753 : }
25754 :
25755 5586 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_td, 0);
25756 5586 : __pyx_v_td = __pyx_t_19;
25757 5586 : __pyx_t_19.memview = NULL;
25758 5586 : __pyx_t_19.data = NULL;
25759 :
25760 : /* "scipy/interpolate/_bspl.pyx":587
25761 : * for d in range(ndim):
25762 : * td = t[d, :len_t[d]]
25763 : * xd = xv[d] # <<<<<<<<<<<<<<
25764 : * kd = k[d]
25765 : *
25766 : */
25767 5586 : __pyx_t_15 = __pyx_v_d;
25768 5586 : __pyx_v_xd = (*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_xv.data) + __pyx_t_15)) )));
25769 :
25770 : /* "scipy/interpolate/_bspl.pyx":588
25771 : * td = t[d, :len_t[d]]
25772 : * xd = xv[d]
25773 : * kd = k[d] # <<<<<<<<<<<<<<
25774 : *
25775 : * # get the location of x[d] in t[d]
25776 : */
25777 5586 : __pyx_t_15 = __pyx_v_d;
25778 5586 : __pyx_v_kd = (*((npy_int32 const *) ( /* dim=0 */ ((char *) (((npy_int32 const *) __pyx_v_k.data) + __pyx_t_15)) )));
25779 :
25780 : /* "scipy/interpolate/_bspl.pyx":591
25781 : *
25782 : * # get the location of x[d] in t[d]
25783 : * i[d] = find_interval(td, kd, xd, kd, extrapolate) # <<<<<<<<<<<<<<
25784 : *
25785 : * if i[d] < 0:
25786 : */
25787 5586 : __pyx_t_15 = __pyx_v_d;
25788 5586 : *((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_i.data) + __pyx_t_15)) )) = __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__pyx_v_td, __pyx_v_kd, __pyx_v_xd, __pyx_v_kd, __pyx_v_extrapolate);
25789 :
25790 : /* "scipy/interpolate/_bspl.pyx":593
25791 : * i[d] = find_interval(td, kd, xd, kd, extrapolate)
25792 : *
25793 : * if i[d] < 0: # <<<<<<<<<<<<<<
25794 : * out_of_bounds = 1
25795 : * break
25796 : */
25797 5586 : __pyx_t_15 = __pyx_v_d;
25798 5586 : __pyx_t_10 = ((*((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_i.data) + __pyx_t_15)) ))) < 0);
25799 5586 : if (__pyx_t_10) {
25800 :
25801 : /* "scipy/interpolate/_bspl.pyx":594
25802 : *
25803 : * if i[d] < 0:
25804 : * out_of_bounds = 1 # <<<<<<<<<<<<<<
25805 : * break
25806 : *
25807 : */
25808 6 : __pyx_v_out_of_bounds = 1;
25809 :
25810 : /* "scipy/interpolate/_bspl.pyx":595
25811 : * if i[d] < 0:
25812 : * out_of_bounds = 1
25813 : * break # <<<<<<<<<<<<<<
25814 : *
25815 : * # compute non-zero b-splines at this value of xd in dimension d
25816 : */
25817 6 : goto __pyx_L14_break;
25818 :
25819 : /* "scipy/interpolate/_bspl.pyx":593
25820 : * i[d] = find_interval(td, kd, xd, kd, extrapolate)
25821 : *
25822 : * if i[d] < 0: # <<<<<<<<<<<<<<
25823 : * out_of_bounds = 1
25824 : * break
25825 : */
25826 : }
25827 :
25828 : /* "scipy/interpolate/_bspl.pyx":598
25829 : *
25830 : * # compute non-zero b-splines at this value of xd in dimension d
25831 : * _deBoor_D(&td[0], xd, kd, i[d], nu[d], &wrk[0]) # <<<<<<<<<<<<<<
25832 : * b[d, :kd+1] = wrk[:kd+1]
25833 : *
25834 : */
25835 5580 : __pyx_t_15 = 0;
25836 5580 : __pyx_t_21 = __pyx_v_d;
25837 5580 : __pyx_t_22 = __pyx_v_d;
25838 5580 : __pyx_t_23 = 0;
25839 5580 : fitpack::_deBoor_D((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_td.data) + __pyx_t_15)) )))), __pyx_v_xd, __pyx_v_kd, (*((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_i.data) + __pyx_t_21)) ))), (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_nu.data) + __pyx_t_22)) ))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_23)) )))));
25840 :
25841 : /* "scipy/interpolate/_bspl.pyx":599
25842 : * # compute non-zero b-splines at this value of xd in dimension d
25843 : * _deBoor_D(&td[0], xd, kd, i[d], nu[d], &wrk[0])
25844 : * b[d, :kd+1] = wrk[:kd+1] # <<<<<<<<<<<<<<
25845 : *
25846 : * if out_of_bounds:
25847 : */
25848 5580 : __pyx_t_9.data = __pyx_v_wrk.data;
25849 5580 : __pyx_t_9.memview = __pyx_v_wrk.memview;
25850 5580 : __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
25851 5580 : __pyx_t_20 = -1;
25852 5580 : if (unlikely(__pyx_memoryview_slice_memviewslice(
25853 : &__pyx_t_9,
25854 : __pyx_v_wrk.shape[0], __pyx_v_wrk.strides[0], __pyx_v_wrk.suboffsets[0],
25855 : 0,
25856 : 0,
25857 : &__pyx_t_20,
25858 : 0,
25859 : (__pyx_v_kd + 1),
25860 : 0,
25861 : 0,
25862 : 1,
25863 : 0,
25864 : 1) < 0))
25865 : {
25866 0 : __PYX_ERR(0, 599, __pyx_L7_error)
25867 : }
25868 :
25869 5580 : __pyx_t_24.data = __pyx_v_b.data;
25870 5580 : __pyx_t_24.memview = __pyx_v_b.memview;
25871 5580 : __PYX_INC_MEMVIEW(&__pyx_t_24, 0);
25872 5580 : {
25873 5580 : Py_ssize_t __pyx_tmp_idx = __pyx_v_d;
25874 5580 : Py_ssize_t __pyx_tmp_stride = __pyx_v_b.strides[0];
25875 5580 : __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
25876 : }
25877 :
25878 5580 : __pyx_t_20 = -1;
25879 5580 : if (unlikely(__pyx_memoryview_slice_memviewslice(
25880 : &__pyx_t_24,
25881 : __pyx_v_b.shape[1], __pyx_v_b.strides[1], __pyx_v_b.suboffsets[1],
25882 : 1,
25883 : 0,
25884 : &__pyx_t_20,
25885 : 0,
25886 : (__pyx_v_kd + 1),
25887 : 0,
25888 : 0,
25889 : 1,
25890 : 0,
25891 : 1) < 0))
25892 : {
25893 0 : __PYX_ERR(0, 599, __pyx_L7_error)
25894 : }
25895 :
25896 5580 : if (unlikely((__pyx_memoryview_copy_contents(__pyx_t_9, __pyx_t_24, 1, 1, 0) < 0))) __PYX_ERR(0, 599, __pyx_L7_error)
25897 5580 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 0);
25898 5580 : __pyx_t_24.memview = NULL; __pyx_t_24.data = NULL;
25899 5580 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 0);
25900 5580 : __pyx_t_9.memview = NULL; __pyx_t_9.data = NULL;
25901 : }
25902 1857 : __pyx_L14_break:;
25903 :
25904 : /* "scipy/interpolate/_bspl.pyx":601
25905 : * b[d, :kd+1] = wrk[:kd+1]
25906 : *
25907 : * if out_of_bounds: # <<<<<<<<<<<<<<
25908 : * # xd was nan or extrapolate=False: Fill the output array
25909 : * # *for this xv value*, and continue to the next xv in xi.
25910 : */
25911 1863 : __pyx_t_10 = (__pyx_v_out_of_bounds != 0);
25912 1863 : if (__pyx_t_10) {
25913 :
25914 : /* "scipy/interpolate/_bspl.pyx":604
25915 : * # xd was nan or extrapolate=False: Fill the output array
25916 : * # *for this xv value*, and continue to the next xv in xi.
25917 : * for i_c in range(num_c_tr): # <<<<<<<<<<<<<<
25918 : * out[j, i_c] = NAN
25919 : * continue
25920 : */
25921 12 : __pyx_t_12 = __pyx_v_num_c_tr;
25922 12 : __pyx_t_13 = __pyx_t_12;
25923 12 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
25924 6 : __pyx_v_i_c = __pyx_t_14;
25925 :
25926 : /* "scipy/interpolate/_bspl.pyx":605
25927 : * # *for this xv value*, and continue to the next xv in xi.
25928 : * for i_c in range(num_c_tr):
25929 : * out[j, i_c] = NAN # <<<<<<<<<<<<<<
25930 : * continue
25931 : *
25932 : */
25933 6 : __pyx_t_23 = __pyx_v_j;
25934 6 : __pyx_t_22 = __pyx_v_i_c;
25935 6 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_23 * __pyx_v_out.strides[0]) )) + __pyx_t_22)) )) = NAN;
25936 : }
25937 :
25938 : /* "scipy/interpolate/_bspl.pyx":606
25939 : * for i_c in range(num_c_tr):
25940 : * out[j, i_c] = NAN
25941 : * continue # <<<<<<<<<<<<<<
25942 : *
25943 : * for i_c in range(num_c_tr):
25944 : */
25945 6 : goto __pyx_L11_continue;
25946 :
25947 : /* "scipy/interpolate/_bspl.pyx":601
25948 : * b[d, :kd+1] = wrk[:kd+1]
25949 : *
25950 : * if out_of_bounds: # <<<<<<<<<<<<<<
25951 : * # xd was nan or extrapolate=False: Fill the output array
25952 : * # *for this xv value*, and continue to the next xv in xi.
25953 : */
25954 : }
25955 :
25956 : /* "scipy/interpolate/_bspl.pyx":608
25957 : * continue
25958 : *
25959 : * for i_c in range(num_c_tr): # <<<<<<<<<<<<<<
25960 : * out[j, i_c] = 0.0
25961 : *
25962 : */
25963 4868 : __pyx_t_12 = __pyx_v_num_c_tr;
25964 4868 : __pyx_t_13 = __pyx_t_12;
25965 4868 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
25966 3011 : __pyx_v_i_c = __pyx_t_14;
25967 :
25968 : /* "scipy/interpolate/_bspl.pyx":609
25969 : *
25970 : * for i_c in range(num_c_tr):
25971 : * out[j, i_c] = 0.0 # <<<<<<<<<<<<<<
25972 : *
25973 : * # iterate over the direct products of non-zero b-splines
25974 : */
25975 3011 : __pyx_t_22 = __pyx_v_j;
25976 3011 : __pyx_t_23 = __pyx_v_i_c;
25977 3011 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_22 * __pyx_v_out.strides[0]) )) + __pyx_t_23)) )) = 0.0;
25978 : }
25979 :
25980 : /* "scipy/interpolate/_bspl.pyx":612
25981 : *
25982 : * # iterate over the direct products of non-zero b-splines
25983 : * for iflat in range(volume): # <<<<<<<<<<<<<<
25984 : * idx_b = indices_k1d[iflat, :]
25985 : * # The line above is equivalent to
25986 : */
25987 153621 : __pyx_t_12 = __pyx_v_volume;
25988 153621 : __pyx_t_13 = __pyx_t_12;
25989 153621 : for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
25990 151764 : __pyx_v_iflat = __pyx_t_14;
25991 :
25992 : /* "scipy/interpolate/_bspl.pyx":613
25993 : * # iterate over the direct products of non-zero b-splines
25994 : * for iflat in range(volume):
25995 : * idx_b = indices_k1d[iflat, :] # <<<<<<<<<<<<<<
25996 : * # The line above is equivalent to
25997 : * # idx_b = np.unravel_index(iflat, (k+1,)*ndim)
25998 : */
25999 151764 : __pyx_t_25.data = __pyx_v_indices_k1d.data;
26000 151764 : __pyx_t_25.memview = __pyx_v_indices_k1d.memview;
26001 151764 : __PYX_INC_MEMVIEW(&__pyx_t_25, 0);
26002 151764 : {
26003 151764 : Py_ssize_t __pyx_tmp_idx = __pyx_v_iflat;
26004 151764 : Py_ssize_t __pyx_tmp_stride = __pyx_v_indices_k1d.strides[0];
26005 151764 : __pyx_t_25.data += __pyx_tmp_idx * __pyx_tmp_stride;
26006 : }
26007 :
26008 151764 : __pyx_t_25.shape[0] = __pyx_v_indices_k1d.shape[1];
26009 151764 : __pyx_t_25.strides[0] = __pyx_v_indices_k1d.strides[1];
26010 151764 : __pyx_t_25.suboffsets[0] = -1;
26011 :
26012 151764 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_idx_b, 0);
26013 151764 : __pyx_v_idx_b = __pyx_t_25;
26014 151764 : __pyx_t_25.memview = NULL;
26015 151764 : __pyx_t_25.data = NULL;
26016 :
26017 : /* "scipy/interpolate/_bspl.pyx":629
26018 : * # idx_cflat = np.ravel_multi_index(tuple(idx_c) + (i_c,),
26019 : * # c1.shape)
26020 : * idx_cflat_base = 0 # <<<<<<<<<<<<<<
26021 : * factor = 1.0
26022 : * for d in range(ndim):
26023 : */
26024 151764 : __pyx_v_idx_cflat_base = 0;
26025 :
26026 : /* "scipy/interpolate/_bspl.pyx":630
26027 : * # c1.shape)
26028 : * idx_cflat_base = 0
26029 : * factor = 1.0 # <<<<<<<<<<<<<<
26030 : * for d in range(ndim):
26031 : * factor *= b[d, idx_b[d]]
26032 : */
26033 151764 : __pyx_v_factor = 1.0;
26034 :
26035 : /* "scipy/interpolate/_bspl.pyx":631
26036 : * idx_cflat_base = 0
26037 : * factor = 1.0
26038 : * for d in range(ndim): # <<<<<<<<<<<<<<
26039 : * factor *= b[d, idx_b[d]]
26040 : * idx = idx_b[d] + i[d] - k[d]
26041 : */
26042 151764 : __pyx_t_26 = __pyx_v_ndim;
26043 151764 : __pyx_t_27 = __pyx_t_26;
26044 722856 : for (__pyx_t_28 = 0; __pyx_t_28 < __pyx_t_27; __pyx_t_28+=1) {
26045 571092 : __pyx_v_d = __pyx_t_28;
26046 :
26047 : /* "scipy/interpolate/_bspl.pyx":632
26048 : * factor = 1.0
26049 : * for d in range(ndim):
26050 : * factor *= b[d, idx_b[d]] # <<<<<<<<<<<<<<
26051 : * idx = idx_b[d] + i[d] - k[d]
26052 : * idx_cflat_base += idx * strides_c1[d]
26053 : */
26054 571092 : __pyx_t_23 = __pyx_v_d;
26055 571092 : __pyx_t_22 = __pyx_v_d;
26056 571092 : __pyx_t_21 = (*((npy_intp const *) ( /* dim=0 */ (__pyx_v_idx_b.data + __pyx_t_23 * __pyx_v_idx_b.strides[0]) )));
26057 571092 : __pyx_v_factor = (__pyx_v_factor * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_22 * __pyx_v_b.strides[0]) )) + __pyx_t_21)) ))));
26058 :
26059 : /* "scipy/interpolate/_bspl.pyx":633
26060 : * for d in range(ndim):
26061 : * factor *= b[d, idx_b[d]]
26062 : * idx = idx_b[d] + i[d] - k[d] # <<<<<<<<<<<<<<
26063 : * idx_cflat_base += idx * strides_c1[d]
26064 : *
26065 : */
26066 571092 : __pyx_t_23 = __pyx_v_d;
26067 571092 : __pyx_t_21 = __pyx_v_d;
26068 571092 : __pyx_t_22 = __pyx_v_d;
26069 571092 : __pyx_v_idx = (((*((npy_intp const *) ( /* dim=0 */ (__pyx_v_idx_b.data + __pyx_t_23 * __pyx_v_idx_b.strides[0]) ))) + (*((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_i.data) + __pyx_t_21)) )))) - (*((npy_int32 const *) ( /* dim=0 */ ((char *) (((npy_int32 const *) __pyx_v_k.data) + __pyx_t_22)) ))));
26070 :
26071 : /* "scipy/interpolate/_bspl.pyx":634
26072 : * factor *= b[d, idx_b[d]]
26073 : * idx = idx_b[d] + i[d] - k[d]
26074 : * idx_cflat_base += idx * strides_c1[d] # <<<<<<<<<<<<<<
26075 : *
26076 : * ### collect linear combinations of coef * factor
26077 : */
26078 571092 : __pyx_t_22 = __pyx_v_d;
26079 571092 : __pyx_v_idx_cflat_base = (__pyx_v_idx_cflat_base + (__pyx_v_idx * (*((npy_intp const *) ( /* dim=0 */ ((char *) (((npy_intp const *) __pyx_v_strides_c1.data) + __pyx_t_22)) )))));
26080 : }
26081 :
26082 : /* "scipy/interpolate/_bspl.pyx":637
26083 : *
26084 : * ### collect linear combinations of coef * factor
26085 : * for i_c in range(num_c_tr): # <<<<<<<<<<<<<<
26086 : * out[j, i_c] = out[j, i_c] + c1r[idx_cflat_base + i_c] * factor
26087 : *
26088 : */
26089 394288 : __pyx_t_26 = __pyx_v_num_c_tr;
26090 394288 : __pyx_t_27 = __pyx_t_26;
26091 394288 : for (__pyx_t_28 = 0; __pyx_t_28 < __pyx_t_27; __pyx_t_28+=1) {
26092 242524 : __pyx_v_i_c = __pyx_t_28;
26093 :
26094 : /* "scipy/interpolate/_bspl.pyx":638
26095 : * ### collect linear combinations of coef * factor
26096 : * for i_c in range(num_c_tr):
26097 : * out[j, i_c] = out[j, i_c] + c1r[idx_cflat_base + i_c] * factor # <<<<<<<<<<<<<<
26098 : *
26099 : *
26100 : */
26101 242524 : __pyx_t_22 = __pyx_v_j;
26102 242524 : __pyx_t_21 = __pyx_v_i_c;
26103 242524 : __pyx_t_23 = (__pyx_v_idx_cflat_base + __pyx_v_i_c);
26104 242524 : __pyx_t_15 = __pyx_v_j;
26105 242524 : __pyx_t_29 = __pyx_v_i_c;
26106 242524 : *((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_15 * __pyx_v_out.strides[0]) )) + __pyx_t_29)) )) = ((*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_out.data + __pyx_t_22 * __pyx_v_out.strides[0]) )) + __pyx_t_21)) ))) + ((*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_c1r.data) + __pyx_t_23)) ))) * __pyx_v_factor));
26107 : }
26108 : }
26109 1863 : __pyx_L11_continue:;
26110 : }
26111 : }
26112 :
26113 : /* "scipy/interpolate/_bspl.pyx":573
26114 : *
26115 : *
26116 : * with nogil: # <<<<<<<<<<<<<<
26117 : * # the number of non-zero terms for each point in ``xi``.
26118 : * volume = 1
26119 : */
26120 201 : /*finally:*/ {
26121 201 : /*normal exit:*/{
26122 : #ifdef WITH_THREAD
26123 201 : __Pyx_FastGIL_Forget();
26124 201 : Py_BLOCK_THREADS
26125 : #endif
26126 201 : goto __pyx_L8;
26127 : }
26128 0 : __pyx_L7_error: {
26129 : #ifdef WITH_THREAD
26130 0 : __Pyx_FastGIL_Forget();
26131 0 : Py_BLOCK_THREADS
26132 : #endif
26133 0 : goto __pyx_L1_error;
26134 : }
26135 201 : __pyx_L8:;
26136 : }
26137 : }
26138 :
26139 : /* "scipy/interpolate/_bspl.pyx":446
26140 : *
26141 : *
26142 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
26143 : * @cython.boundscheck(False)
26144 : * @cython.nonecheck(False)
26145 : */
26146 :
26147 : /* function exit code */
26148 201 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26149 201 : goto __pyx_L0;
26150 0 : __pyx_L1_error:;
26151 0 : __Pyx_XDECREF(__pyx_t_2);
26152 0 : __Pyx_XDECREF(__pyx_t_3);
26153 0 : __Pyx_XDECREF(__pyx_t_4);
26154 0 : __Pyx_XDECREF(__pyx_t_5);
26155 0 : __Pyx_XDECREF(__pyx_t_6);
26156 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
26157 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
26158 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_9, 1);
26159 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1);
26160 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_19, 1);
26161 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 1);
26162 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_25, 1);
26163 0 : __Pyx_AddTraceback("scipy.interpolate._bspl.evaluate_ndbspline", __pyx_clineno, __pyx_lineno, __pyx_filename);
26164 : __pyx_r = NULL;
26165 201 : __pyx_L0:;
26166 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_i, 1);
26167 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_b, 1);
26168 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xv, 1);
26169 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_td, 1);
26170 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_idx_b, 1);
26171 201 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_wrk, 1);
26172 201 : __Pyx_XGIVEREF(__pyx_r);
26173 201 : __Pyx_RefNannyFinishContext();
26174 201 : return __pyx_r;
26175 : }
26176 :
26177 : /* "scipy/interpolate/_bspl.pyx":641
26178 : *
26179 : *
26180 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
26181 : * @cython.nonecheck(False)
26182 : * @cython.boundscheck(False)
26183 : */
26184 :
26185 : /* Python wrapper */
26186 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_15_colloc_nd(PyObject *__pyx_self,
26187 : #if CYTHON_METH_FASTCALL
26188 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26189 : #else
26190 : PyObject *__pyx_args, PyObject *__pyx_kwds
26191 : #endif
26192 : ); /*proto*/
26193 : PyDoc_STRVAR(__pyx_doc_5scipy_11interpolate_5_bspl_14_colloc_nd, "Construct the N-D tensor product collocation matrix as a CSR array.\n\n In the dense representation, each row of the collocation matrix corresponds\n to a data point and contains non-zero b-spline basis functions which are\n non-zero at this data point.\n\n Parameters\n ----------\n xvals : ndarray, shape(size, ndim)\n Data points. ``xvals[j, :]`` gives the ``j``-th data point as an\n ``ndim``-dimensional array.\n t : tuple of 1D arrays, length-ndim\n Tuple of knot vectors\n k : ndarray, shape (ndim,)\n Spline degrees\n\n Returns\n -------\n csr_data, csr_indices, csr_indptr\n The collocation matrix in the CSR array format.\n\n Notes\n -----\n Algorithm: given `xvals` and the tuple of knots `t`, we construct a tensor\n product spline, i.e. a linear combination of\n\n B(x1; i1, t1) * B(x2; i2, t2) * ... * B(xN; iN, tN)\n\n\n Here ``B(x; i, t)`` is the ``i``-th b-spline defined by the knot vector\n ``t`` evaluated at ``x``.\n\n Since ``B`` functions are localized, for each point `(x1, ..., xN)` we\n loop over the dimensions, and\n - find the location in the knot array, `t[i] <= x < t[i+1]`,\n - compute all non-zero `B` values\n - place these values into the relevant row\n\n In the dense representation, the collocation matrix would have had a row per\n data point, and each row has the values of the basis elements (i.e., tensor\n products of B-splines) evaluated at this data point. Since the matrix is very\n sparse (has size = len(x)**ndim, with only (k+1)**ndim non-zero elements per\n row), we construct it in the CSR format.\n ");
26194 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_15_colloc_nd = {"_colloc_nd", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_15_colloc_nd, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_11interpolate_5_bspl_14_colloc_nd};
26195 146 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_15_colloc_nd(PyObject *__pyx_self,
26196 : #if CYTHON_METH_FASTCALL
26197 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
26198 : #else
26199 : PyObject *__pyx_args, PyObject *__pyx_kwds
26200 : #endif
26201 : ) {
26202 146 : __Pyx_memviewslice __pyx_v_xvals = { 0, 0, { 0 }, { 0 }, { 0 } };
26203 146 : __Pyx_memviewslice __pyx_v__t = { 0, 0, { 0 }, { 0 }, { 0 } };
26204 146 : __Pyx_memviewslice __pyx_v_len_t = { 0, 0, { 0 }, { 0 }, { 0 } };
26205 146 : __Pyx_memviewslice __pyx_v_k = { 0, 0, { 0 }, { 0 }, { 0 } };
26206 146 : __Pyx_memviewslice __pyx_v__indices_k1d = { 0, 0, { 0 }, { 0 }, { 0 } };
26207 146 : __Pyx_memviewslice __pyx_v__cstrides = { 0, 0, { 0 }, { 0 }, { 0 } };
26208 : #if !CYTHON_METH_FASTCALL
26209 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
26210 : #endif
26211 146 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
26212 146 : PyObject* values[6] = {0,0,0,0,0,0};
26213 146 : int __pyx_lineno = 0;
26214 146 : const char *__pyx_filename = NULL;
26215 146 : int __pyx_clineno = 0;
26216 146 : PyObject *__pyx_r = 0;
26217 : __Pyx_RefNannyDeclarations
26218 146 : __Pyx_RefNannySetupContext("_colloc_nd (wrapper)", 0);
26219 : #if !CYTHON_METH_FASTCALL
26220 : #if CYTHON_ASSUME_SAFE_MACROS
26221 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
26222 : #else
26223 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
26224 : #endif
26225 : #endif
26226 146 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
26227 146 : {
26228 146 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xvals,&__pyx_n_s_t_2,&__pyx_n_s_len_t,&__pyx_n_s_k,&__pyx_n_s_indices_k1d_2,&__pyx_n_s_cstrides,0};
26229 146 : if (__pyx_kwds) {
26230 0 : Py_ssize_t kw_args;
26231 0 : switch (__pyx_nargs) {
26232 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
26233 0 : CYTHON_FALLTHROUGH;
26234 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
26235 0 : CYTHON_FALLTHROUGH;
26236 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
26237 0 : CYTHON_FALLTHROUGH;
26238 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
26239 0 : CYTHON_FALLTHROUGH;
26240 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
26241 0 : CYTHON_FALLTHROUGH;
26242 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
26243 0 : CYTHON_FALLTHROUGH;
26244 0 : case 0: break;
26245 0 : default: goto __pyx_L5_argtuple_error;
26246 : }
26247 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
26248 0 : switch (__pyx_nargs) {
26249 0 : case 0:
26250 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xvals)) != 0)) {
26251 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
26252 0 : kw_args--;
26253 : }
26254 1 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error)
26255 0 : else goto __pyx_L5_argtuple_error;
26256 0 : CYTHON_FALLTHROUGH;
26257 0 : case 1:
26258 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t_2)) != 0)) {
26259 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
26260 0 : kw_args--;
26261 : }
26262 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error)
26263 : else {
26264 0 : __Pyx_RaiseArgtupleInvalid("_colloc_nd", 1, 6, 6, 1); __PYX_ERR(0, 641, __pyx_L3_error)
26265 : }
26266 0 : CYTHON_FALLTHROUGH;
26267 0 : case 2:
26268 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_len_t)) != 0)) {
26269 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
26270 0 : kw_args--;
26271 : }
26272 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error)
26273 : else {
26274 0 : __Pyx_RaiseArgtupleInvalid("_colloc_nd", 1, 6, 6, 2); __PYX_ERR(0, 641, __pyx_L3_error)
26275 : }
26276 0 : CYTHON_FALLTHROUGH;
26277 0 : case 3:
26278 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
26279 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
26280 0 : kw_args--;
26281 : }
26282 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error)
26283 : else {
26284 0 : __Pyx_RaiseArgtupleInvalid("_colloc_nd", 1, 6, 6, 3); __PYX_ERR(0, 641, __pyx_L3_error)
26285 : }
26286 0 : CYTHON_FALLTHROUGH;
26287 0 : case 4:
26288 0 : if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_indices_k1d_2)) != 0)) {
26289 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
26290 0 : kw_args--;
26291 : }
26292 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error)
26293 : else {
26294 0 : __Pyx_RaiseArgtupleInvalid("_colloc_nd", 1, 6, 6, 4); __PYX_ERR(0, 641, __pyx_L3_error)
26295 : }
26296 0 : CYTHON_FALLTHROUGH;
26297 0 : case 5:
26298 0 : if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_cstrides)) != 0)) {
26299 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[5]);
26300 0 : kw_args--;
26301 : }
26302 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error)
26303 : else {
26304 0 : __Pyx_RaiseArgtupleInvalid("_colloc_nd", 1, 6, 6, 5); __PYX_ERR(0, 641, __pyx_L3_error)
26305 : }
26306 : }
26307 0 : if (unlikely(kw_args > 0)) {
26308 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
26309 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_colloc_nd") < 0)) __PYX_ERR(0, 641, __pyx_L3_error)
26310 : }
26311 146 : } else if (unlikely(__pyx_nargs != 6)) {
26312 0 : goto __pyx_L5_argtuple_error;
26313 : } else {
26314 146 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
26315 146 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
26316 146 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
26317 146 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
26318 146 : values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
26319 146 : values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
26320 : }
26321 146 : __pyx_v_xvals = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_xvals.memview)) __PYX_ERR(0, 644, __pyx_L3_error)
26322 145 : __pyx_v__t = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v__t.memview)) __PYX_ERR(0, 645, __pyx_L3_error)
26323 145 : __pyx_v_len_t = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32__const__(values[2], 0); if (unlikely(!__pyx_v_len_t.memview)) __PYX_ERR(0, 646, __pyx_L3_error)
26324 145 : __pyx_v_k = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32__const__(values[3], 0); if (unlikely(!__pyx_v_k.memview)) __PYX_ERR(0, 647, __pyx_L3_error)
26325 145 : __pyx_v__indices_k1d = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn_npy_intp__const__(values[4], 0); if (unlikely(!__pyx_v__indices_k1d.memview)) __PYX_ERR(0, 648, __pyx_L3_error)
26326 145 : __pyx_v__cstrides = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp__const__(values[5], 0); if (unlikely(!__pyx_v__cstrides.memview)) __PYX_ERR(0, 649, __pyx_L3_error)
26327 : }
26328 145 : goto __pyx_L6_skip;
26329 0 : __pyx_L5_argtuple_error:;
26330 0 : __Pyx_RaiseArgtupleInvalid("_colloc_nd", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 641, __pyx_L3_error)
26331 145 : __pyx_L6_skip:;
26332 145 : goto __pyx_L4_argument_unpacking_done;
26333 1 : __pyx_L3_error:;
26334 1 : {
26335 1 : Py_ssize_t __pyx_temp;
26336 1 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26337 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
26338 : }
26339 : }
26340 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xvals, 1);
26341 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_v__t, 1);
26342 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_len_t, 1);
26343 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_k, 1);
26344 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_v__indices_k1d, 1);
26345 1 : __PYX_XCLEAR_MEMVIEW(&__pyx_v__cstrides, 1);
26346 1 : __Pyx_AddTraceback("scipy.interpolate._bspl._colloc_nd", __pyx_clineno, __pyx_lineno, __pyx_filename);
26347 : __Pyx_RefNannyFinishContext();
26348 : return NULL;
26349 145 : __pyx_L4_argument_unpacking_done:;
26350 145 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_14_colloc_nd(__pyx_self, __pyx_v_xvals, __pyx_v__t, __pyx_v_len_t, __pyx_v_k, __pyx_v__indices_k1d, __pyx_v__cstrides);
26351 :
26352 : /* function exit code */
26353 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xvals, 1);
26354 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v__t, 1);
26355 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_len_t, 1);
26356 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_k, 1);
26357 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v__indices_k1d, 1);
26358 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v__cstrides, 1);
26359 : {
26360 : Py_ssize_t __pyx_temp;
26361 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
26362 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
26363 : }
26364 : }
26365 : __Pyx_RefNannyFinishContext();
26366 : return __pyx_r;
26367 : }
26368 :
26369 145 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_14_colloc_nd(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_xvals, __Pyx_memviewslice __pyx_v__t, __Pyx_memviewslice __pyx_v_len_t, __Pyx_memviewslice __pyx_v_k, __Pyx_memviewslice __pyx_v__indices_k1d, __Pyx_memviewslice __pyx_v__cstrides) {
26370 145 : npy_intp __pyx_v_size;
26371 145 : npy_intp __pyx_v_ndim;
26372 145 : __Pyx_memviewslice __pyx_v_i = { 0, 0, { 0 }, { 0 }, { 0 } };
26373 145 : __Pyx_memviewslice __pyx_v_b = { 0, 0, { 0 }, { 0 }, { 0 } };
26374 145 : double __pyx_v_xd;
26375 145 : __Pyx_memviewslice __pyx_v_td = { 0, 0, { 0 }, { 0 }, { 0 } };
26376 145 : npy_intp __pyx_v_kd;
26377 145 : npy_intp __pyx_v_iflat;
26378 145 : npy_intp __pyx_v_volume;
26379 145 : __Pyx_memviewslice __pyx_v_idx_c = { 0, 0, { 0 }, { 0 }, { 0 } };
26380 145 : npy_intp __pyx_v_idx_cflat;
26381 145 : __Pyx_memviewslice __pyx_v_nu = { 0, 0, { 0 }, { 0 }, { 0 } };
26382 145 : int __pyx_v_out_of_bounds;
26383 145 : double __pyx_v_factor;
26384 145 : __Pyx_memviewslice __pyx_v_wrk = { 0, 0, { 0 }, { 0 }, { 0 } };
26385 145 : __Pyx_memviewslice __pyx_v_csr_data = { 0, 0, { 0 }, { 0 }, { 0 } };
26386 145 : __Pyx_memviewslice __pyx_v_csr_indices = { 0, 0, { 0 }, { 0 }, { 0 } };
26387 145 : int __pyx_v_j;
26388 145 : int __pyx_v_d;
26389 145 : PyObject *__pyx_v_csr_indptr = NULL;
26390 145 : __Pyx_memviewslice __pyx_v_xv = { 0, 0, { 0 }, { 0 }, { 0 } };
26391 145 : __Pyx_memviewslice __pyx_v_idx_b = { 0, 0, { 0 }, { 0 }, { 0 } };
26392 145 : PyObject *__pyx_r = NULL;
26393 : __Pyx_RefNannyDeclarations
26394 145 : PyObject *__pyx_t_1 = NULL;
26395 145 : PyObject *__pyx_t_2 = NULL;
26396 145 : PyObject *__pyx_t_3 = NULL;
26397 145 : PyObject *__pyx_t_4 = NULL;
26398 145 : PyObject *__pyx_t_5 = NULL;
26399 145 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
26400 145 : __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
26401 145 : __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
26402 145 : npy_intp __pyx_t_9;
26403 145 : npy_intp __pyx_t_10;
26404 145 : int __pyx_t_11;
26405 145 : Py_ssize_t __pyx_t_12;
26406 145 : __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
26407 145 : __Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
26408 145 : npy_intp __pyx_t_15;
26409 145 : npy_intp __pyx_t_16;
26410 145 : int __pyx_t_17;
26411 145 : __Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
26412 145 : int __pyx_t_19;
26413 145 : int __pyx_t_20;
26414 145 : Py_ssize_t __pyx_t_21;
26415 145 : Py_ssize_t __pyx_t_22;
26416 145 : Py_ssize_t __pyx_t_23;
26417 145 : __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } };
26418 145 : Py_ssize_t __pyx_t_25;
26419 145 : Py_UCS4 __pyx_t_26;
26420 145 : npy_intp __pyx_t_27;
26421 145 : __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } };
26422 145 : npy_intp __pyx_t_29;
26423 145 : npy_intp __pyx_t_30;
26424 145 : unsigned int __pyx_t_31;
26425 145 : int __pyx_lineno = 0;
26426 145 : const char *__pyx_filename = NULL;
26427 145 : int __pyx_clineno = 0;
26428 145 : __Pyx_RefNannySetupContext("_colloc_nd", 1);
26429 :
26430 : /* "scipy/interpolate/_bspl.pyx":695
26431 : * """
26432 : * cdef:
26433 : * npy_intp size = xvals.shape[0] # <<<<<<<<<<<<<<
26434 : * npy_intp ndim = xvals.shape[1]
26435 : *
26436 : */
26437 145 : __pyx_v_size = (__pyx_v_xvals.shape[0]);
26438 :
26439 : /* "scipy/interpolate/_bspl.pyx":696
26440 : * cdef:
26441 : * npy_intp size = xvals.shape[0]
26442 : * npy_intp ndim = xvals.shape[1] # <<<<<<<<<<<<<<
26443 : *
26444 : * # 'intervals': indices for a point in xi into the knot arrays t
26445 : */
26446 145 : __pyx_v_ndim = (__pyx_v_xvals.shape[1]);
26447 :
26448 : /* "scipy/interpolate/_bspl.pyx":699
26449 : *
26450 : * # 'intervals': indices for a point in xi into the knot arrays t
26451 : * npy_intp[::1] i = np.empty(ndim, dtype=np.intp) # <<<<<<<<<<<<<<
26452 : *
26453 : * # container for non-zero b-splines at each point in xi
26454 : */
26455 145 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
26456 145 : __Pyx_GOTREF(__pyx_t_1);
26457 145 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 699, __pyx_L1_error)
26458 145 : __Pyx_GOTREF(__pyx_t_2);
26459 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26460 145 : __pyx_t_1 = __Pyx_PyInt_From_npy_intp(__pyx_v_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
26461 145 : __Pyx_GOTREF(__pyx_t_1);
26462 145 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
26463 145 : __Pyx_GOTREF(__pyx_t_3);
26464 145 : __Pyx_GIVEREF(__pyx_t_1);
26465 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error);
26466 145 : __pyx_t_1 = 0;
26467 145 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error)
26468 145 : __Pyx_GOTREF(__pyx_t_1);
26469 145 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 699, __pyx_L1_error)
26470 145 : __Pyx_GOTREF(__pyx_t_4);
26471 145 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
26472 145 : __Pyx_GOTREF(__pyx_t_5);
26473 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26474 145 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 699, __pyx_L1_error)
26475 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26476 145 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
26477 145 : __Pyx_GOTREF(__pyx_t_5);
26478 145 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26479 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26480 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26481 145 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 699, __pyx_L1_error)
26482 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26483 145 : __pyx_v_i = __pyx_t_6;
26484 145 : __pyx_t_6.memview = NULL;
26485 145 : __pyx_t_6.data = NULL;
26486 :
26487 : /* "scipy/interpolate/_bspl.pyx":702
26488 : *
26489 : * # container for non-zero b-splines at each point in xi
26490 : * double[:, ::1] b = np.empty((ndim, max(k) + 1), dtype=float) # <<<<<<<<<<<<<<
26491 : *
26492 : * double xd # d-th component of x
26493 : */
26494 145 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
26495 145 : __Pyx_GOTREF(__pyx_t_5);
26496 145 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error)
26497 145 : __Pyx_GOTREF(__pyx_t_1);
26498 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26499 145 : __pyx_t_5 = __Pyx_PyInt_From_npy_intp(__pyx_v_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
26500 145 : __Pyx_GOTREF(__pyx_t_5);
26501 145 : __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_k, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_npy_int32__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
26502 145 : __Pyx_GOTREF(__pyx_t_3);
26503 145 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
26504 145 : __Pyx_GOTREF(__pyx_t_2);
26505 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26506 145 : __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
26507 145 : __Pyx_GOTREF(__pyx_t_3);
26508 145 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26509 145 : __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
26510 145 : __Pyx_GOTREF(__pyx_t_2);
26511 145 : __Pyx_GIVEREF(__pyx_t_5);
26512 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error);
26513 145 : __Pyx_GIVEREF(__pyx_t_3);
26514 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error);
26515 145 : __pyx_t_5 = 0;
26516 145 : __pyx_t_3 = 0;
26517 145 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error)
26518 145 : __Pyx_GOTREF(__pyx_t_3);
26519 145 : __Pyx_GIVEREF(__pyx_t_2);
26520 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error);
26521 145 : __pyx_t_2 = 0;
26522 145 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error)
26523 145 : __Pyx_GOTREF(__pyx_t_2);
26524 145 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
26525 145 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
26526 145 : __Pyx_GOTREF(__pyx_t_5);
26527 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26528 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26529 145 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26530 145 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 702, __pyx_L1_error)
26531 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26532 145 : __pyx_v_b = __pyx_t_7;
26533 145 : __pyx_t_7.memview = NULL;
26534 145 : __pyx_t_7.data = NULL;
26535 :
26536 : /* "scipy/interpolate/_bspl.pyx":712
26537 : *
26538 : * # shifted indices into the data array
26539 : * npy_intp[::1] idx_c = np.ones(ndim, dtype=np.intp) * (-101) # any sentinel would do, really # <<<<<<<<<<<<<<
26540 : * npy_intp idx_cflat
26541 : *
26542 : */
26543 145 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
26544 145 : __Pyx_GOTREF(__pyx_t_5);
26545 145 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
26546 145 : __Pyx_GOTREF(__pyx_t_2);
26547 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26548 145 : __pyx_t_5 = __Pyx_PyInt_From_npy_intp(__pyx_v_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
26549 145 : __Pyx_GOTREF(__pyx_t_5);
26550 145 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
26551 145 : __Pyx_GOTREF(__pyx_t_3);
26552 145 : __Pyx_GIVEREF(__pyx_t_5);
26553 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error);
26554 145 : __pyx_t_5 = 0;
26555 145 : __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
26556 145 : __Pyx_GOTREF(__pyx_t_5);
26557 145 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error)
26558 145 : __Pyx_GOTREF(__pyx_t_1);
26559 145 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error)
26560 145 : __Pyx_GOTREF(__pyx_t_4);
26561 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26562 145 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 712, __pyx_L1_error)
26563 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26564 145 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error)
26565 145 : __Pyx_GOTREF(__pyx_t_4);
26566 145 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26567 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26568 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26569 145 : __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_t_4, __pyx_int_neg_101, -101L, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
26570 145 : __Pyx_GOTREF(__pyx_t_5);
26571 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26572 145 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 712, __pyx_L1_error)
26573 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26574 145 : __pyx_v_idx_c = __pyx_t_6;
26575 145 : __pyx_t_6.memview = NULL;
26576 145 : __pyx_t_6.data = NULL;
26577 :
26578 : /* "scipy/interpolate/_bspl.pyx":715
26579 : * npy_intp idx_cflat
26580 : *
26581 : * npy_intp[::1] nu = np.zeros(ndim, dtype=np.intp) # <<<<<<<<<<<<<<
26582 : *
26583 : * int out_of_bounds
26584 : */
26585 145 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error)
26586 145 : __Pyx_GOTREF(__pyx_t_5);
26587 145 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 715, __pyx_L1_error)
26588 145 : __Pyx_GOTREF(__pyx_t_4);
26589 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26590 145 : __pyx_t_5 = __Pyx_PyInt_From_npy_intp(__pyx_v_ndim); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error)
26591 145 : __Pyx_GOTREF(__pyx_t_5);
26592 145 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error)
26593 145 : __Pyx_GOTREF(__pyx_t_3);
26594 145 : __Pyx_GIVEREF(__pyx_t_5);
26595 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error);
26596 145 : __pyx_t_5 = 0;
26597 145 : __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 715, __pyx_L1_error)
26598 145 : __Pyx_GOTREF(__pyx_t_5);
26599 145 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error)
26600 145 : __Pyx_GOTREF(__pyx_t_2);
26601 145 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error)
26602 145 : __Pyx_GOTREF(__pyx_t_1);
26603 145 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26604 145 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
26605 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26606 145 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error)
26607 145 : __Pyx_GOTREF(__pyx_t_1);
26608 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26609 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26610 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26611 145 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 715, __pyx_L1_error)
26612 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26613 145 : __pyx_v_nu = __pyx_t_6;
26614 145 : __pyx_t_6.memview = NULL;
26615 145 : __pyx_t_6.data = NULL;
26616 :
26617 : /* "scipy/interpolate/_bspl.pyx":719
26618 : * int out_of_bounds
26619 : * double factor
26620 : * double[::1] wrk = np.empty(2*max(k) + 2, dtype=float) # <<<<<<<<<<<<<<
26621 : *
26622 : * # output
26623 : */
26624 145 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
26625 145 : __Pyx_GOTREF(__pyx_t_1);
26626 145 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L1_error)
26627 145 : __Pyx_GOTREF(__pyx_t_5);
26628 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26629 145 : __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_k, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_npy_int32__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
26630 145 : __Pyx_GOTREF(__pyx_t_1);
26631 145 : __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error)
26632 145 : __Pyx_GOTREF(__pyx_t_3);
26633 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26634 145 : __pyx_t_1 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_t_3, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
26635 145 : __Pyx_GOTREF(__pyx_t_1);
26636 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26637 145 : __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error)
26638 145 : __Pyx_GOTREF(__pyx_t_3);
26639 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26640 145 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 719, __pyx_L1_error)
26641 145 : __Pyx_GOTREF(__pyx_t_1);
26642 145 : __Pyx_GIVEREF(__pyx_t_3);
26643 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error);
26644 145 : __pyx_t_3 = 0;
26645 145 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 719, __pyx_L1_error)
26646 145 : __Pyx_GOTREF(__pyx_t_3);
26647 145 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 719, __pyx_L1_error)
26648 145 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error)
26649 145 : __Pyx_GOTREF(__pyx_t_4);
26650 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26651 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26652 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26653 145 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 719, __pyx_L1_error)
26654 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26655 145 : __pyx_v_wrk = __pyx_t_8;
26656 145 : __pyx_t_8.memview = NULL;
26657 145 : __pyx_t_8.data = NULL;
26658 :
26659 : /* "scipy/interpolate/_bspl.pyx":728
26660 : *
26661 : * # the number of non-zero b-splines for each data point.
26662 : * volume = 1 # <<<<<<<<<<<<<<
26663 : * for d in range(ndim):
26664 : * volume *= k[d] + 1
26665 : */
26666 145 : __pyx_v_volume = 1;
26667 :
26668 : /* "scipy/interpolate/_bspl.pyx":729
26669 : * # the number of non-zero b-splines for each data point.
26670 : * volume = 1
26671 : * for d in range(ndim): # <<<<<<<<<<<<<<
26672 : * volume *= k[d] + 1
26673 : *
26674 : */
26675 145 : __pyx_t_9 = __pyx_v_ndim;
26676 145 : __pyx_t_10 = __pyx_t_9;
26677 605 : for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
26678 460 : __pyx_v_d = __pyx_t_11;
26679 :
26680 : /* "scipy/interpolate/_bspl.pyx":730
26681 : * volume = 1
26682 : * for d in range(ndim):
26683 : * volume *= k[d] + 1 # <<<<<<<<<<<<<<
26684 : *
26685 : * # Allocate the collocation matrix in the CSR format.
26686 : */
26687 460 : __pyx_t_12 = __pyx_v_d;
26688 460 : __pyx_v_volume = (__pyx_v_volume * ((*((npy_int32 const *) ( /* dim=0 */ ((char *) (((npy_int32 const *) __pyx_v_k.data) + __pyx_t_12)) ))) + 1));
26689 : }
26690 :
26691 : /* "scipy/interpolate/_bspl.pyx":735
26692 : * # If dense, this would have been
26693 : * # >>> matr = np.zeros((size, max_row_index), dtype=float)
26694 : * csr_indices = np.empty(shape=(size*volume,), dtype=np.int64) # <<<<<<<<<<<<<<
26695 : * csr_data = np.empty(shape=(size*volume,), dtype=float)
26696 : * csr_indptr = np.arange(0, volume*size + 1, volume, dtype=np.int64)
26697 : */
26698 145 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
26699 145 : __Pyx_GOTREF(__pyx_t_4);
26700 145 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error)
26701 145 : __Pyx_GOTREF(__pyx_t_3);
26702 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26703 145 : __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
26704 145 : __Pyx_GOTREF(__pyx_t_4);
26705 145 : __pyx_t_1 = __Pyx_PyInt_From_npy_intp((__pyx_v_size * __pyx_v_volume)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
26706 145 : __Pyx_GOTREF(__pyx_t_1);
26707 145 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error)
26708 145 : __Pyx_GOTREF(__pyx_t_5);
26709 145 : __Pyx_GIVEREF(__pyx_t_1);
26710 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error);
26711 145 : __pyx_t_1 = 0;
26712 145 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
26713 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26714 145 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error)
26715 145 : __Pyx_GOTREF(__pyx_t_5);
26716 145 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
26717 145 : __Pyx_GOTREF(__pyx_t_1);
26718 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26719 145 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
26720 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26721 145 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
26722 145 : __Pyx_GOTREF(__pyx_t_1);
26723 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26724 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26725 145 : __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int64(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 735, __pyx_L1_error)
26726 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26727 145 : __pyx_v_csr_indices = __pyx_t_13;
26728 145 : __pyx_t_13.memview = NULL;
26729 145 : __pyx_t_13.data = NULL;
26730 :
26731 : /* "scipy/interpolate/_bspl.pyx":736
26732 : * # >>> matr = np.zeros((size, max_row_index), dtype=float)
26733 : * csr_indices = np.empty(shape=(size*volume,), dtype=np.int64)
26734 : * csr_data = np.empty(shape=(size*volume,), dtype=float) # <<<<<<<<<<<<<<
26735 : * csr_indptr = np.arange(0, volume*size + 1, volume, dtype=np.int64)
26736 : *
26737 : */
26738 145 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
26739 145 : __Pyx_GOTREF(__pyx_t_1);
26740 145 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 736, __pyx_L1_error)
26741 145 : __Pyx_GOTREF(__pyx_t_4);
26742 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26743 145 : __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error)
26744 145 : __Pyx_GOTREF(__pyx_t_1);
26745 145 : __pyx_t_3 = __Pyx_PyInt_From_npy_intp((__pyx_v_size * __pyx_v_volume)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error)
26746 145 : __Pyx_GOTREF(__pyx_t_3);
26747 145 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error)
26748 145 : __Pyx_GOTREF(__pyx_t_5);
26749 145 : __Pyx_GIVEREF(__pyx_t_3);
26750 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 736, __pyx_L1_error);
26751 145 : __pyx_t_3 = 0;
26752 145 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
26753 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26754 145 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
26755 145 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error)
26756 145 : __Pyx_GOTREF(__pyx_t_5);
26757 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26758 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26759 145 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 736, __pyx_L1_error)
26760 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26761 145 : __pyx_v_csr_data = __pyx_t_8;
26762 145 : __pyx_t_8.memview = NULL;
26763 145 : __pyx_t_8.data = NULL;
26764 :
26765 : /* "scipy/interpolate/_bspl.pyx":737
26766 : * csr_indices = np.empty(shape=(size*volume,), dtype=np.int64)
26767 : * csr_data = np.empty(shape=(size*volume,), dtype=float)
26768 : * csr_indptr = np.arange(0, volume*size + 1, volume, dtype=np.int64) # <<<<<<<<<<<<<<
26769 : *
26770 : * # ### Iterate over the data points ###
26771 : */
26772 145 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
26773 145 : __Pyx_GOTREF(__pyx_t_5);
26774 145 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
26775 145 : __Pyx_GOTREF(__pyx_t_1);
26776 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26777 145 : __pyx_t_5 = __Pyx_PyInt_From_npy_intp(((__pyx_v_volume * __pyx_v_size) + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
26778 145 : __Pyx_GOTREF(__pyx_t_5);
26779 145 : __pyx_t_4 = __Pyx_PyInt_From_npy_intp(__pyx_v_volume); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error)
26780 145 : __Pyx_GOTREF(__pyx_t_4);
26781 145 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error)
26782 145 : __Pyx_GOTREF(__pyx_t_3);
26783 145 : __Pyx_INCREF(__pyx_int_0);
26784 145 : __Pyx_GIVEREF(__pyx_int_0);
26785 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 737, __pyx_L1_error);
26786 145 : __Pyx_GIVEREF(__pyx_t_5);
26787 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error);
26788 145 : __Pyx_GIVEREF(__pyx_t_4);
26789 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error);
26790 145 : __pyx_t_5 = 0;
26791 145 : __pyx_t_4 = 0;
26792 145 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 737, __pyx_L1_error)
26793 145 : __Pyx_GOTREF(__pyx_t_4);
26794 145 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
26795 145 : __Pyx_GOTREF(__pyx_t_5);
26796 145 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
26797 145 : __Pyx_GOTREF(__pyx_t_2);
26798 145 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26799 145 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
26800 145 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26801 145 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
26802 145 : __Pyx_GOTREF(__pyx_t_2);
26803 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26804 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26805 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26806 699734 : __pyx_v_csr_indptr = __pyx_t_2;
26807 699734 : __pyx_t_2 = 0;
26808 :
26809 : /* "scipy/interpolate/_bspl.pyx":740
26810 : *
26811 : * # ### Iterate over the data points ###
26812 : * for j in range(size): # <<<<<<<<<<<<<<
26813 : * xv = xvals[j, :]
26814 : *
26815 : */
26816 699734 : __pyx_t_9 = __pyx_v_size;
26817 699734 : __pyx_t_10 = __pyx_t_9;
26818 699734 : for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
26819 699589 : __pyx_v_j = __pyx_t_11;
26820 :
26821 : /* "scipy/interpolate/_bspl.pyx":741
26822 : * # ### Iterate over the data points ###
26823 : * for j in range(size):
26824 : * xv = xvals[j, :] # <<<<<<<<<<<<<<
26825 : *
26826 : * # For each point, iterate over the dimensions
26827 : */
26828 699589 : __pyx_t_14.data = __pyx_v_xvals.data;
26829 699589 : __pyx_t_14.memview = __pyx_v_xvals.memview;
26830 699589 : __PYX_INC_MEMVIEW(&__pyx_t_14, 1);
26831 699589 : {
26832 699589 : Py_ssize_t __pyx_tmp_idx = __pyx_v_j;
26833 699589 : Py_ssize_t __pyx_tmp_stride = __pyx_v_xvals.strides[0];
26834 699589 : __pyx_t_14.data += __pyx_tmp_idx * __pyx_tmp_stride;
26835 : }
26836 :
26837 699589 : __pyx_t_14.shape[0] = __pyx_v_xvals.shape[1];
26838 699589 : __pyx_t_14.strides[0] = __pyx_v_xvals.strides[1];
26839 699589 : __pyx_t_14.suboffsets[0] = -1;
26840 :
26841 699589 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xv, 1);
26842 699589 : __pyx_v_xv = __pyx_t_14;
26843 699589 : __pyx_t_14.memview = NULL;
26844 699589 : __pyx_t_14.data = NULL;
26845 :
26846 : /* "scipy/interpolate/_bspl.pyx":744
26847 : *
26848 : * # For each point, iterate over the dimensions
26849 : * out_of_bounds = 0 # <<<<<<<<<<<<<<
26850 : * for d in range(ndim):
26851 : * td = _t[d, :len_t[d]]
26852 : */
26853 699589 : __pyx_v_out_of_bounds = 0;
26854 :
26855 : /* "scipy/interpolate/_bspl.pyx":745
26856 : * # For each point, iterate over the dimensions
26857 : * out_of_bounds = 0
26858 : * for d in range(ndim): # <<<<<<<<<<<<<<
26859 : * td = _t[d, :len_t[d]]
26860 : * xd = xv[d]
26861 : */
26862 699589 : __pyx_t_15 = __pyx_v_ndim;
26863 699589 : __pyx_t_16 = __pyx_t_15;
26864 3979063 : for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
26865 3279474 : __pyx_v_d = __pyx_t_17;
26866 :
26867 : /* "scipy/interpolate/_bspl.pyx":746
26868 : * out_of_bounds = 0
26869 : * for d in range(ndim):
26870 : * td = _t[d, :len_t[d]] # <<<<<<<<<<<<<<
26871 : * xd = xv[d]
26872 : * kd = k[d]
26873 : */
26874 3279474 : __pyx_t_12 = __pyx_v_d;
26875 3279474 : __pyx_t_18.data = __pyx_v__t.data;
26876 3279474 : __pyx_t_18.memview = __pyx_v__t.memview;
26877 3279474 : __PYX_INC_MEMVIEW(&__pyx_t_18, 1);
26878 3279474 : {
26879 3279474 : Py_ssize_t __pyx_tmp_idx = __pyx_v_d;
26880 3279474 : Py_ssize_t __pyx_tmp_stride = __pyx_v__t.strides[0];
26881 3279474 : __pyx_t_18.data += __pyx_tmp_idx * __pyx_tmp_stride;
26882 : }
26883 :
26884 3279474 : __pyx_t_19 = -1;
26885 3279474 : if (unlikely(__pyx_memoryview_slice_memviewslice(
26886 : &__pyx_t_18,
26887 : __pyx_v__t.shape[1], __pyx_v__t.strides[1], __pyx_v__t.suboffsets[1],
26888 : 1,
26889 : 0,
26890 : &__pyx_t_19,
26891 : 0,
26892 : (*((npy_int32 const *) ( /* dim=0 */ ((char *) (((npy_int32 const *) __pyx_v_len_t.data) + __pyx_t_12)) ))),
26893 : 0,
26894 : 0,
26895 : 1,
26896 : 0,
26897 : 1) < 0))
26898 : {
26899 0 : __PYX_ERR(0, 746, __pyx_L1_error)
26900 : }
26901 :
26902 3279474 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_td, 1);
26903 3279474 : __pyx_v_td = __pyx_t_18;
26904 3279474 : __pyx_t_18.memview = NULL;
26905 3279474 : __pyx_t_18.data = NULL;
26906 :
26907 : /* "scipy/interpolate/_bspl.pyx":747
26908 : * for d in range(ndim):
26909 : * td = _t[d, :len_t[d]]
26910 : * xd = xv[d] # <<<<<<<<<<<<<<
26911 : * kd = k[d]
26912 : *
26913 : */
26914 3279474 : __pyx_t_12 = __pyx_v_d;
26915 3279474 : __pyx_v_xd = (*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_xv.data) + __pyx_t_12)) )));
26916 :
26917 : /* "scipy/interpolate/_bspl.pyx":748
26918 : * td = _t[d, :len_t[d]]
26919 : * xd = xv[d]
26920 : * kd = k[d] # <<<<<<<<<<<<<<
26921 : *
26922 : * # get the location of x[d] in t[d]
26923 : */
26924 3279474 : __pyx_t_12 = __pyx_v_d;
26925 3279474 : __pyx_v_kd = (*((npy_int32 const *) ( /* dim=0 */ ((char *) (((npy_int32 const *) __pyx_v_k.data) + __pyx_t_12)) )));
26926 :
26927 : /* "scipy/interpolate/_bspl.pyx":751
26928 : *
26929 : * # get the location of x[d] in t[d]
26930 : * i[d] = find_interval(td, kd, xd, kd, extrapolate=True) # <<<<<<<<<<<<<<
26931 : *
26932 : * if i[d] < 0:
26933 : */
26934 3279474 : __pyx_t_12 = __pyx_v_d;
26935 3279474 : *((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_i.data) + __pyx_t_12)) )) = __pyx_f_5scipy_11interpolate_5_bspl_find_interval(__pyx_v_td, __pyx_v_kd, __pyx_v_xd, __pyx_v_kd, 1);
26936 :
26937 : /* "scipy/interpolate/_bspl.pyx":753
26938 : * i[d] = find_interval(td, kd, xd, kd, extrapolate=True)
26939 : *
26940 : * if i[d] < 0: # <<<<<<<<<<<<<<
26941 : * out_of_bounds = 1
26942 : * break
26943 : */
26944 3279474 : __pyx_t_12 = __pyx_v_d;
26945 3279474 : __pyx_t_20 = ((*((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_i.data) + __pyx_t_12)) ))) < 0);
26946 3279474 : if (__pyx_t_20) {
26947 :
26948 : /* "scipy/interpolate/_bspl.pyx":754
26949 : *
26950 : * if i[d] < 0:
26951 : * out_of_bounds = 1 # <<<<<<<<<<<<<<
26952 : * break
26953 : *
26954 : */
26955 0 : __pyx_v_out_of_bounds = 1;
26956 :
26957 : /* "scipy/interpolate/_bspl.pyx":755
26958 : * if i[d] < 0:
26959 : * out_of_bounds = 1
26960 : * break # <<<<<<<<<<<<<<
26961 : *
26962 : * # compute non-zero b-splines at this value of xd in dimension d
26963 : */
26964 0 : goto __pyx_L8_break;
26965 :
26966 : /* "scipy/interpolate/_bspl.pyx":753
26967 : * i[d] = find_interval(td, kd, xd, kd, extrapolate=True)
26968 : *
26969 : * if i[d] < 0: # <<<<<<<<<<<<<<
26970 : * out_of_bounds = 1
26971 : * break
26972 : */
26973 : }
26974 :
26975 : /* "scipy/interpolate/_bspl.pyx":758
26976 : *
26977 : * # compute non-zero b-splines at this value of xd in dimension d
26978 : * _deBoor_D(&td[0], xd, kd, i[d], nu[d], &wrk[0]) # <<<<<<<<<<<<<<
26979 : * b[d, :kd+1] = wrk[:kd+1]
26980 : *
26981 : */
26982 3279474 : __pyx_t_12 = 0;
26983 3279474 : __pyx_t_21 = __pyx_v_d;
26984 3279474 : __pyx_t_22 = __pyx_v_d;
26985 3279474 : __pyx_t_23 = 0;
26986 3279474 : fitpack::_deBoor_D((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_td.data) + __pyx_t_12)) )))), __pyx_v_xd, __pyx_v_kd, (*((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_i.data) + __pyx_t_21)) ))), (*((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_nu.data) + __pyx_t_22)) ))), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_23)) )))));
26987 :
26988 : /* "scipy/interpolate/_bspl.pyx":759
26989 : * # compute non-zero b-splines at this value of xd in dimension d
26990 : * _deBoor_D(&td[0], xd, kd, i[d], nu[d], &wrk[0])
26991 : * b[d, :kd+1] = wrk[:kd+1] # <<<<<<<<<<<<<<
26992 : *
26993 : * if out_of_bounds:
26994 : */
26995 3279474 : __pyx_t_8.data = __pyx_v_wrk.data;
26996 3279474 : __pyx_t_8.memview = __pyx_v_wrk.memview;
26997 3279474 : __PYX_INC_MEMVIEW(&__pyx_t_8, 1);
26998 3279474 : __pyx_t_19 = -1;
26999 3279474 : if (unlikely(__pyx_memoryview_slice_memviewslice(
27000 : &__pyx_t_8,
27001 : __pyx_v_wrk.shape[0], __pyx_v_wrk.strides[0], __pyx_v_wrk.suboffsets[0],
27002 : 0,
27003 : 0,
27004 : &__pyx_t_19,
27005 : 0,
27006 : (__pyx_v_kd + 1),
27007 : 0,
27008 : 0,
27009 : 1,
27010 : 0,
27011 : 1) < 0))
27012 : {
27013 0 : __PYX_ERR(0, 759, __pyx_L1_error)
27014 : }
27015 :
27016 3279474 : __pyx_t_24.data = __pyx_v_b.data;
27017 3279474 : __pyx_t_24.memview = __pyx_v_b.memview;
27018 3279474 : __PYX_INC_MEMVIEW(&__pyx_t_24, 1);
27019 3279474 : {
27020 3279474 : Py_ssize_t __pyx_tmp_idx = __pyx_v_d;
27021 3279474 : Py_ssize_t __pyx_tmp_stride = __pyx_v_b.strides[0];
27022 3279474 : __pyx_t_24.data += __pyx_tmp_idx * __pyx_tmp_stride;
27023 : }
27024 :
27025 3279474 : __pyx_t_19 = -1;
27026 3279474 : if (unlikely(__pyx_memoryview_slice_memviewslice(
27027 : &__pyx_t_24,
27028 : __pyx_v_b.shape[1], __pyx_v_b.strides[1], __pyx_v_b.suboffsets[1],
27029 : 1,
27030 : 0,
27031 : &__pyx_t_19,
27032 : 0,
27033 : (__pyx_v_kd + 1),
27034 : 0,
27035 : 0,
27036 : 1,
27037 : 0,
27038 : 1) < 0))
27039 : {
27040 0 : __PYX_ERR(0, 759, __pyx_L1_error)
27041 : }
27042 :
27043 3279474 : if (unlikely((__pyx_memoryview_copy_contents(__pyx_t_8, __pyx_t_24, 1, 1, 0) < 0))) __PYX_ERR(0, 759, __pyx_L1_error)
27044 3279474 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 1);
27045 3279474 : __pyx_t_24.memview = NULL; __pyx_t_24.data = NULL;
27046 3279474 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
27047 3279474 : __pyx_t_8.memview = NULL; __pyx_t_8.data = NULL;
27048 : }
27049 699589 : __pyx_L8_break:;
27050 :
27051 : /* "scipy/interpolate/_bspl.pyx":761
27052 : * b[d, :kd+1] = wrk[:kd+1]
27053 : *
27054 : * if out_of_bounds: # <<<<<<<<<<<<<<
27055 : * raise ValueError(f"Out of bounds in {d = }, with {xv = }")
27056 : *
27057 : */
27058 699589 : __pyx_t_20 = (__pyx_v_out_of_bounds != 0);
27059 699589 : if (unlikely(__pyx_t_20)) {
27060 :
27061 : /* "scipy/interpolate/_bspl.pyx":762
27062 : *
27063 : * if out_of_bounds:
27064 : * raise ValueError(f"Out of bounds in {d = }, with {xv = }") # <<<<<<<<<<<<<<
27065 : *
27066 : * # Iterate over the products of non-zero b-splines and place them
27067 : */
27068 0 : __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error)
27069 0 : __Pyx_GOTREF(__pyx_t_2);
27070 0 : __pyx_t_25 = 0;
27071 0 : __pyx_t_26 = 127;
27072 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_in_d);
27073 0 : __pyx_t_25 += 21;
27074 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_in_d);
27075 0 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_Out_of_bounds_in_d);
27076 0 : __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_d, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error)
27077 0 : __Pyx_GOTREF(__pyx_t_4);
27078 0 : __pyx_t_25 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
27079 0 : __Pyx_GIVEREF(__pyx_t_4);
27080 0 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
27081 0 : __pyx_t_4 = 0;
27082 0 : __Pyx_INCREF(__pyx_kp_u_with_xv);
27083 0 : __pyx_t_25 += 12;
27084 0 : __Pyx_GIVEREF(__pyx_kp_u_with_xv);
27085 0 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_with_xv);
27086 0 : __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_xv, 1, (PyObject *(*)(char *)) __pyx_memview_get_double__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 762, __pyx_L1_error)
27087 0 : __Pyx_GOTREF(__pyx_t_4);
27088 0 : __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error)
27089 0 : __Pyx_GOTREF(__pyx_t_3);
27090 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27091 0 : __pyx_t_26 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_26) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_26;
27092 0 : __pyx_t_25 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
27093 0 : __Pyx_GIVEREF(__pyx_t_3);
27094 0 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
27095 0 : __pyx_t_3 = 0;
27096 0 : __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_25, __pyx_t_26); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 762, __pyx_L1_error)
27097 0 : __Pyx_GOTREF(__pyx_t_3);
27098 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27099 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 762, __pyx_L1_error)
27100 0 : __Pyx_GOTREF(__pyx_t_2);
27101 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27102 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
27103 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27104 0 : __PYX_ERR(0, 762, __pyx_L1_error)
27105 :
27106 : /* "scipy/interpolate/_bspl.pyx":761
27107 : * b[d, :kd+1] = wrk[:kd+1]
27108 : *
27109 : * if out_of_bounds: # <<<<<<<<<<<<<<
27110 : * raise ValueError(f"Out of bounds in {d = }, with {xv = }")
27111 : *
27112 : */
27113 : }
27114 :
27115 : /* "scipy/interpolate/_bspl.pyx":766
27116 : * # Iterate over the products of non-zero b-splines and place them
27117 : * # into the current row of the design matrix
27118 : * for iflat in range(volume): # <<<<<<<<<<<<<<
27119 : * # the line below is an unrolled version of
27120 : * # idx_b = np.unravel_index(iflat, tuple(kd+1 for kd in k))
27121 : */
27122 44614845 : __pyx_t_15 = __pyx_v_volume;
27123 44614845 : __pyx_t_16 = __pyx_t_15;
27124 44614845 : for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_16; __pyx_t_27+=1) {
27125 43915256 : __pyx_v_iflat = __pyx_t_27;
27126 :
27127 : /* "scipy/interpolate/_bspl.pyx":769
27128 : * # the line below is an unrolled version of
27129 : * # idx_b = np.unravel_index(iflat, tuple(kd+1 for kd in k))
27130 : * idx_b = _indices_k1d[iflat, :] # <<<<<<<<<<<<<<
27131 : *
27132 : * factor = 1.0
27133 : */
27134 43915256 : __pyx_t_28.data = __pyx_v__indices_k1d.data;
27135 43915256 : __pyx_t_28.memview = __pyx_v__indices_k1d.memview;
27136 43915256 : __PYX_INC_MEMVIEW(&__pyx_t_28, 1);
27137 43915256 : {
27138 43915256 : Py_ssize_t __pyx_tmp_idx = __pyx_v_iflat;
27139 43915256 : Py_ssize_t __pyx_tmp_stride = __pyx_v__indices_k1d.strides[0];
27140 43915256 : __pyx_t_28.data += __pyx_tmp_idx * __pyx_tmp_stride;
27141 : }
27142 :
27143 43915256 : __pyx_t_28.shape[0] = __pyx_v__indices_k1d.shape[1];
27144 43915256 : __pyx_t_28.strides[0] = __pyx_v__indices_k1d.strides[1];
27145 43915256 : __pyx_t_28.suboffsets[0] = -1;
27146 :
27147 43915256 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_idx_b, 1);
27148 43915256 : __pyx_v_idx_b = __pyx_t_28;
27149 43915256 : __pyx_t_28.memview = NULL;
27150 43915256 : __pyx_t_28.data = NULL;
27151 :
27152 : /* "scipy/interpolate/_bspl.pyx":771
27153 : * idx_b = _indices_k1d[iflat, :]
27154 : *
27155 : * factor = 1.0 # <<<<<<<<<<<<<<
27156 : * idx_cflat = 0
27157 : * for d in range(ndim):
27158 : */
27159 43915256 : __pyx_v_factor = 1.0;
27160 :
27161 : /* "scipy/interpolate/_bspl.pyx":772
27162 : *
27163 : * factor = 1.0
27164 : * idx_cflat = 0 # <<<<<<<<<<<<<<
27165 : * for d in range(ndim):
27166 : * factor *= b[d, idx_b[d]]
27167 : */
27168 43915256 : __pyx_v_idx_cflat = 0;
27169 :
27170 : /* "scipy/interpolate/_bspl.pyx":773
27171 : * factor = 1.0
27172 : * idx_cflat = 0
27173 : * for d in range(ndim): # <<<<<<<<<<<<<<
27174 : * factor *= b[d, idx_b[d]]
27175 : * idx_c[d] = idx_b[d] + i[d] - k[d]
27176 : */
27177 43915256 : __pyx_t_29 = __pyx_v_ndim;
27178 43915256 : __pyx_t_30 = __pyx_t_29;
27179 234321504 : for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_30; __pyx_t_17+=1) {
27180 190406248 : __pyx_v_d = __pyx_t_17;
27181 :
27182 : /* "scipy/interpolate/_bspl.pyx":774
27183 : * idx_cflat = 0
27184 : * for d in range(ndim):
27185 : * factor *= b[d, idx_b[d]] # <<<<<<<<<<<<<<
27186 : * idx_c[d] = idx_b[d] + i[d] - k[d]
27187 : * idx_cflat += idx_c[d] * _cstrides[d]
27188 : */
27189 190406248 : __pyx_t_23 = __pyx_v_d;
27190 190406248 : __pyx_t_22 = __pyx_v_d;
27191 190406248 : __pyx_t_21 = (*((npy_intp const *) ( /* dim=0 */ ((char *) (((npy_intp const *) __pyx_v_idx_b.data) + __pyx_t_23)) )));
27192 190406248 : __pyx_v_factor = (__pyx_v_factor * (*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_b.data + __pyx_t_22 * __pyx_v_b.strides[0]) )) + __pyx_t_21)) ))));
27193 :
27194 : /* "scipy/interpolate/_bspl.pyx":775
27195 : * for d in range(ndim):
27196 : * factor *= b[d, idx_b[d]]
27197 : * idx_c[d] = idx_b[d] + i[d] - k[d] # <<<<<<<<<<<<<<
27198 : * idx_cflat += idx_c[d] * _cstrides[d]
27199 : *
27200 : */
27201 190406248 : __pyx_t_23 = __pyx_v_d;
27202 190406248 : __pyx_t_21 = __pyx_v_d;
27203 190406248 : __pyx_t_22 = __pyx_v_d;
27204 190406248 : __pyx_t_12 = __pyx_v_d;
27205 190406248 : *((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_idx_c.data) + __pyx_t_12)) )) = (((*((npy_intp const *) ( /* dim=0 */ ((char *) (((npy_intp const *) __pyx_v_idx_b.data) + __pyx_t_23)) ))) + (*((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_i.data) + __pyx_t_21)) )))) - (*((npy_int32 const *) ( /* dim=0 */ ((char *) (((npy_int32 const *) __pyx_v_k.data) + __pyx_t_22)) ))));
27206 :
27207 : /* "scipy/interpolate/_bspl.pyx":776
27208 : * factor *= b[d, idx_b[d]]
27209 : * idx_c[d] = idx_b[d] + i[d] - k[d]
27210 : * idx_cflat += idx_c[d] * _cstrides[d] # <<<<<<<<<<<<<<
27211 : *
27212 : * # The `idx_cflat` computation above is an unrolled version of
27213 : */
27214 190406248 : __pyx_t_22 = __pyx_v_d;
27215 190406248 : __pyx_t_21 = __pyx_v_d;
27216 190406248 : __pyx_v_idx_cflat = (__pyx_v_idx_cflat + ((*((npy_intp *) ( /* dim=0 */ ((char *) (((npy_intp *) __pyx_v_idx_c.data) + __pyx_t_22)) ))) * (*((npy_intp const *) ( /* dim=0 */ ((char *) (((npy_intp const *) __pyx_v__cstrides.data) + __pyx_t_21)) )))));
27217 : }
27218 :
27219 : /* "scipy/interpolate/_bspl.pyx":787
27220 : * # Each row of the full matrix has `volume` non-zero elements.
27221 : * # Thus the CSR format `indptr` increases in steps of `volume`
27222 : * csr_indices[j*volume + iflat] = idx_cflat # <<<<<<<<<<<<<<
27223 : * csr_data[j*volume + iflat] = factor
27224 : *
27225 : */
27226 43915256 : __pyx_t_21 = ((__pyx_v_j * __pyx_v_volume) + __pyx_v_iflat);
27227 43915256 : *((npy_int64 *) ( /* dim=0 */ ((char *) (((npy_int64 *) __pyx_v_csr_indices.data) + __pyx_t_21)) )) = __pyx_v_idx_cflat;
27228 :
27229 : /* "scipy/interpolate/_bspl.pyx":788
27230 : * # Thus the CSR format `indptr` increases in steps of `volume`
27231 : * csr_indices[j*volume + iflat] = idx_cflat
27232 : * csr_data[j*volume + iflat] = factor # <<<<<<<<<<<<<<
27233 : *
27234 : * return np.asarray(csr_data), np.asarray(csr_indices), csr_indptr
27235 : */
27236 43915256 : __pyx_t_21 = ((__pyx_v_j * __pyx_v_volume) + __pyx_v_iflat);
27237 43915256 : *((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_csr_data.data) + __pyx_t_21)) )) = __pyx_v_factor;
27238 : }
27239 : }
27240 :
27241 : /* "scipy/interpolate/_bspl.pyx":790
27242 : * csr_data[j*volume + iflat] = factor
27243 : *
27244 : * return np.asarray(csr_data), np.asarray(csr_indices), csr_indptr # <<<<<<<<<<<<<<
27245 : *
27246 : *
27247 : */
27248 145 : __Pyx_XDECREF(__pyx_r);
27249 145 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error)
27250 145 : __Pyx_GOTREF(__pyx_t_3);
27251 145 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error)
27252 145 : __Pyx_GOTREF(__pyx_t_4);
27253 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27254 145 : __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_csr_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error)
27255 145 : __Pyx_GOTREF(__pyx_t_3);
27256 145 : __pyx_t_1 = NULL;
27257 145 : __pyx_t_31 = 0;
27258 : #if CYTHON_UNPACK_METHODS
27259 145 : if (unlikely(PyMethod_Check(__pyx_t_4))) {
27260 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
27261 0 : if (likely(__pyx_t_1)) {
27262 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
27263 0 : __Pyx_INCREF(__pyx_t_1);
27264 0 : __Pyx_INCREF(function);
27265 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
27266 : __pyx_t_31 = 1;
27267 : }
27268 : }
27269 : #endif
27270 145 : {
27271 145 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3};
27272 145 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_31, 1+__pyx_t_31);
27273 145 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
27274 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27275 145 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error)
27276 145 : __Pyx_GOTREF(__pyx_t_2);
27277 145 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27278 : }
27279 145 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error)
27280 145 : __Pyx_GOTREF(__pyx_t_3);
27281 145 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
27282 145 : __Pyx_GOTREF(__pyx_t_1);
27283 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27284 145 : __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_csr_indices, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn_npy_int64, (int (*)(char *, PyObject *)) __pyx_memview_set_nn_npy_int64, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 790, __pyx_L1_error)
27285 145 : __Pyx_GOTREF(__pyx_t_3);
27286 145 : __pyx_t_5 = NULL;
27287 145 : __pyx_t_31 = 0;
27288 : #if CYTHON_UNPACK_METHODS
27289 145 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
27290 0 : __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
27291 0 : if (likely(__pyx_t_5)) {
27292 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
27293 0 : __Pyx_INCREF(__pyx_t_5);
27294 0 : __Pyx_INCREF(function);
27295 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
27296 : __pyx_t_31 = 1;
27297 : }
27298 : }
27299 : #endif
27300 145 : {
27301 145 : PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
27302 145 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_31, 1+__pyx_t_31);
27303 145 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27304 145 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27305 145 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error)
27306 145 : __Pyx_GOTREF(__pyx_t_4);
27307 145 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27308 : }
27309 145 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 790, __pyx_L1_error)
27310 145 : __Pyx_GOTREF(__pyx_t_1);
27311 145 : __Pyx_GIVEREF(__pyx_t_2);
27312 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 790, __pyx_L1_error);
27313 145 : __Pyx_GIVEREF(__pyx_t_4);
27314 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 790, __pyx_L1_error);
27315 145 : __Pyx_INCREF(__pyx_v_csr_indptr);
27316 145 : __Pyx_GIVEREF(__pyx_v_csr_indptr);
27317 145 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_csr_indptr)) __PYX_ERR(0, 790, __pyx_L1_error);
27318 145 : __pyx_t_2 = 0;
27319 145 : __pyx_t_4 = 0;
27320 145 : __pyx_r = __pyx_t_1;
27321 145 : __pyx_t_1 = 0;
27322 145 : goto __pyx_L0;
27323 :
27324 : /* "scipy/interpolate/_bspl.pyx":641
27325 : *
27326 : *
27327 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
27328 : * @cython.nonecheck(False)
27329 : * @cython.boundscheck(False)
27330 : */
27331 :
27332 : /* function exit code */
27333 0 : __pyx_L1_error:;
27334 0 : __Pyx_XDECREF(__pyx_t_1);
27335 0 : __Pyx_XDECREF(__pyx_t_2);
27336 0 : __Pyx_XDECREF(__pyx_t_3);
27337 0 : __Pyx_XDECREF(__pyx_t_4);
27338 0 : __Pyx_XDECREF(__pyx_t_5);
27339 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
27340 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
27341 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
27342 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_13, 1);
27343 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_14, 1);
27344 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_18, 1);
27345 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_24, 1);
27346 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_28, 1);
27347 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._colloc_nd", __pyx_clineno, __pyx_lineno, __pyx_filename);
27348 : __pyx_r = NULL;
27349 145 : __pyx_L0:;
27350 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_i, 1);
27351 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_b, 1);
27352 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_td, 1);
27353 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_idx_c, 1);
27354 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_nu, 1);
27355 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_wrk, 1);
27356 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_csr_data, 1);
27357 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_csr_indices, 1);
27358 145 : __Pyx_XDECREF(__pyx_v_csr_indptr);
27359 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_xv, 1);
27360 145 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_idx_b, 1);
27361 145 : __Pyx_XGIVEREF(__pyx_r);
27362 145 : __Pyx_RefNannyFinishContext();
27363 145 : return __pyx_r;
27364 : }
27365 :
27366 : /* "scipy/interpolate/_bspl.pyx":796
27367 : * # wrappers for fitpack repro
27368 : * # ---------------------------
27369 : * def _qr_reduce(double[:, ::1] a, ssize_t[::1] offset, ssize_t nc, # A packed # <<<<<<<<<<<<<<
27370 : * double[:, ::1] y,
27371 : * ssize_t startrow=1
27372 : */
27373 :
27374 : /* Python wrapper */
27375 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_17_qr_reduce(PyObject *__pyx_self,
27376 : #if CYTHON_METH_FASTCALL
27377 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
27378 : #else
27379 : PyObject *__pyx_args, PyObject *__pyx_kwds
27380 : #endif
27381 : ); /*proto*/
27382 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_17_qr_reduce = {"_qr_reduce", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_17_qr_reduce, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
27383 430 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_17_qr_reduce(PyObject *__pyx_self,
27384 : #if CYTHON_METH_FASTCALL
27385 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
27386 : #else
27387 : PyObject *__pyx_args, PyObject *__pyx_kwds
27388 : #endif
27389 : ) {
27390 430 : __Pyx_memviewslice __pyx_v_a = { 0, 0, { 0 }, { 0 }, { 0 } };
27391 430 : __Pyx_memviewslice __pyx_v_offset = { 0, 0, { 0 }, { 0 }, { 0 } };
27392 430 : Py_ssize_t __pyx_v_nc;
27393 430 : __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
27394 430 : Py_ssize_t __pyx_v_startrow;
27395 : #if !CYTHON_METH_FASTCALL
27396 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
27397 : #endif
27398 430 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
27399 430 : PyObject* values[5] = {0,0,0,0,0};
27400 430 : int __pyx_lineno = 0;
27401 430 : const char *__pyx_filename = NULL;
27402 430 : int __pyx_clineno = 0;
27403 430 : PyObject *__pyx_r = 0;
27404 : __Pyx_RefNannyDeclarations
27405 430 : __Pyx_RefNannySetupContext("_qr_reduce (wrapper)", 0);
27406 : #if !CYTHON_METH_FASTCALL
27407 : #if CYTHON_ASSUME_SAFE_MACROS
27408 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
27409 : #else
27410 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
27411 : #endif
27412 : #endif
27413 430 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
27414 430 : {
27415 430 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_offset,&__pyx_n_s_nc,&__pyx_n_s_y,&__pyx_n_s_startrow,0};
27416 430 : if (__pyx_kwds) {
27417 159 : Py_ssize_t kw_args;
27418 159 : switch (__pyx_nargs) {
27419 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
27420 159 : CYTHON_FALLTHROUGH;
27421 159 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
27422 159 : CYTHON_FALLTHROUGH;
27423 159 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
27424 159 : CYTHON_FALLTHROUGH;
27425 159 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
27426 159 : CYTHON_FALLTHROUGH;
27427 159 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
27428 159 : CYTHON_FALLTHROUGH;
27429 159 : case 0: break;
27430 0 : default: goto __pyx_L5_argtuple_error;
27431 : }
27432 159 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
27433 159 : switch (__pyx_nargs) {
27434 0 : case 0:
27435 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) {
27436 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
27437 0 : kw_args--;
27438 : }
27439 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error)
27440 0 : else goto __pyx_L5_argtuple_error;
27441 0 : CYTHON_FALLTHROUGH;
27442 0 : case 1:
27443 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_offset)) != 0)) {
27444 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
27445 0 : kw_args--;
27446 : }
27447 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error)
27448 : else {
27449 0 : __Pyx_RaiseArgtupleInvalid("_qr_reduce", 0, 4, 5, 1); __PYX_ERR(0, 796, __pyx_L3_error)
27450 : }
27451 0 : CYTHON_FALLTHROUGH;
27452 0 : case 2:
27453 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nc)) != 0)) {
27454 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
27455 0 : kw_args--;
27456 : }
27457 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error)
27458 : else {
27459 0 : __Pyx_RaiseArgtupleInvalid("_qr_reduce", 0, 4, 5, 2); __PYX_ERR(0, 796, __pyx_L3_error)
27460 : }
27461 0 : CYTHON_FALLTHROUGH;
27462 0 : case 3:
27463 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) {
27464 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
27465 0 : kw_args--;
27466 : }
27467 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error)
27468 : else {
27469 0 : __Pyx_RaiseArgtupleInvalid("_qr_reduce", 0, 4, 5, 3); __PYX_ERR(0, 796, __pyx_L3_error)
27470 : }
27471 159 : CYTHON_FALLTHROUGH;
27472 159 : case 4:
27473 159 : if (kw_args > 0) {
27474 159 : PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_startrow);
27475 159 : if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
27476 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error)
27477 : }
27478 : }
27479 159 : if (unlikely(kw_args > 0)) {
27480 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
27481 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_qr_reduce") < 0)) __PYX_ERR(0, 796, __pyx_L3_error)
27482 : }
27483 : } else {
27484 271 : switch (__pyx_nargs) {
27485 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
27486 271 : CYTHON_FALLTHROUGH;
27487 271 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
27488 271 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
27489 271 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
27490 271 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
27491 271 : break;
27492 0 : default: goto __pyx_L5_argtuple_error;
27493 : }
27494 : }
27495 430 : __pyx_v_a = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0], PyBUF_WRITABLE); if (unlikely(!__pyx_v_a.memview)) __PYX_ERR(0, 796, __pyx_L3_error)
27496 430 : __pyx_v_offset = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(values[1], PyBUF_WRITABLE); if (unlikely(!__pyx_v_offset.memview)) __PYX_ERR(0, 796, __pyx_L3_error)
27497 430 : __pyx_v_nc = PyInt_AsSsize_t(values[2]); if (unlikely((__pyx_v_nc == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error)
27498 430 : __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[3], PyBUF_WRITABLE); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 797, __pyx_L3_error)
27499 430 : if (values[4]) {
27500 159 : __pyx_v_startrow = PyInt_AsSsize_t(values[4]); if (unlikely((__pyx_v_startrow == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L3_error)
27501 : } else {
27502 : __pyx_v_startrow = ((Py_ssize_t)((Py_ssize_t)1));
27503 : }
27504 : }
27505 430 : goto __pyx_L6_skip;
27506 0 : __pyx_L5_argtuple_error:;
27507 0 : __Pyx_RaiseArgtupleInvalid("_qr_reduce", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 796, __pyx_L3_error)
27508 430 : __pyx_L6_skip:;
27509 430 : goto __pyx_L4_argument_unpacking_done;
27510 0 : __pyx_L3_error:;
27511 0 : {
27512 0 : Py_ssize_t __pyx_temp;
27513 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
27514 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
27515 : }
27516 : }
27517 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_a, 1);
27518 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_offset, 1);
27519 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
27520 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._qr_reduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
27521 : __Pyx_RefNannyFinishContext();
27522 : return NULL;
27523 430 : __pyx_L4_argument_unpacking_done:;
27524 430 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_16_qr_reduce(__pyx_self, __pyx_v_a, __pyx_v_offset, __pyx_v_nc, __pyx_v_y, __pyx_v_startrow);
27525 :
27526 : /* function exit code */
27527 430 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_a, 1);
27528 430 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_offset, 1);
27529 430 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
27530 : {
27531 : Py_ssize_t __pyx_temp;
27532 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
27533 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
27534 : }
27535 : }
27536 : __Pyx_RefNannyFinishContext();
27537 : return __pyx_r;
27538 : }
27539 :
27540 430 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_16_qr_reduce(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_a, __Pyx_memviewslice __pyx_v_offset, Py_ssize_t __pyx_v_nc, __Pyx_memviewslice __pyx_v_y, Py_ssize_t __pyx_v_startrow) {
27541 430 : PyObject *__pyx_r = NULL;
27542 : __Pyx_RefNannyDeclarations
27543 430 : Py_ssize_t __pyx_t_1;
27544 430 : Py_ssize_t __pyx_t_2;
27545 430 : int __pyx_t_3;
27546 430 : Py_ssize_t __pyx_t_4;
27547 430 : Py_ssize_t __pyx_t_5;
27548 430 : Py_ssize_t __pyx_t_6;
27549 430 : int __pyx_lineno = 0;
27550 430 : const char *__pyx_filename = NULL;
27551 430 : int __pyx_clineno = 0;
27552 430 : __Pyx_RefNannySetupContext("_qr_reduce", 1);
27553 :
27554 : /* "scipy/interpolate/_bspl.pyx":801
27555 : * ):
27556 : * # (A, offset, nc) is a PackedMatrix instance, unpacked
27557 : * qr_reduce(&a[0, 0], a.shape[0], a.shape[1], # <<<<<<<<<<<<<<
27558 : * &offset[0],
27559 : * nc,
27560 : */
27561 430 : __pyx_t_1 = 0;
27562 430 : __pyx_t_2 = 0;
27563 430 : __pyx_t_3 = -1;
27564 430 : if (__pyx_t_1 < 0) {
27565 : __pyx_t_1 += __pyx_v_a.shape[0];
27566 : if (unlikely(__pyx_t_1 < 0)) __pyx_t_3 = 0;
27567 430 : } else if (unlikely(__pyx_t_1 >= __pyx_v_a.shape[0])) __pyx_t_3 = 0;
27568 430 : if (__pyx_t_2 < 0) {
27569 : __pyx_t_2 += __pyx_v_a.shape[1];
27570 : if (unlikely(__pyx_t_2 < 0)) __pyx_t_3 = 1;
27571 430 : } else if (unlikely(__pyx_t_2 >= __pyx_v_a.shape[1])) __pyx_t_3 = 1;
27572 430 : if (unlikely(__pyx_t_3 != -1)) {
27573 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
27574 0 : __PYX_ERR(0, 801, __pyx_L1_error)
27575 : }
27576 :
27577 : /* "scipy/interpolate/_bspl.pyx":802
27578 : * # (A, offset, nc) is a PackedMatrix instance, unpacked
27579 : * qr_reduce(&a[0, 0], a.shape[0], a.shape[1],
27580 : * &offset[0], # <<<<<<<<<<<<<<
27581 : * nc,
27582 : * &y[0, 0], y.shape[1],
27583 : */
27584 430 : __pyx_t_4 = 0;
27585 430 : __pyx_t_3 = -1;
27586 430 : if (__pyx_t_4 < 0) {
27587 : __pyx_t_4 += __pyx_v_offset.shape[0];
27588 : if (unlikely(__pyx_t_4 < 0)) __pyx_t_3 = 0;
27589 430 : } else if (unlikely(__pyx_t_4 >= __pyx_v_offset.shape[0])) __pyx_t_3 = 0;
27590 430 : if (unlikely(__pyx_t_3 != -1)) {
27591 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
27592 0 : __PYX_ERR(0, 802, __pyx_L1_error)
27593 : }
27594 :
27595 : /* "scipy/interpolate/_bspl.pyx":804
27596 : * &offset[0],
27597 : * nc,
27598 : * &y[0, 0], y.shape[1], # <<<<<<<<<<<<<<
27599 : * startrow)
27600 : *
27601 : */
27602 430 : __pyx_t_5 = 0;
27603 430 : __pyx_t_6 = 0;
27604 430 : __pyx_t_3 = -1;
27605 430 : if (__pyx_t_5 < 0) {
27606 : __pyx_t_5 += __pyx_v_y.shape[0];
27607 : if (unlikely(__pyx_t_5 < 0)) __pyx_t_3 = 0;
27608 430 : } else if (unlikely(__pyx_t_5 >= __pyx_v_y.shape[0])) __pyx_t_3 = 0;
27609 430 : if (__pyx_t_6 < 0) {
27610 : __pyx_t_6 += __pyx_v_y.shape[1];
27611 : if (unlikely(__pyx_t_6 < 0)) __pyx_t_3 = 1;
27612 430 : } else if (unlikely(__pyx_t_6 >= __pyx_v_y.shape[1])) __pyx_t_3 = 1;
27613 430 : if (unlikely(__pyx_t_3 != -1)) {
27614 0 : __Pyx_RaiseBufferIndexError(__pyx_t_3);
27615 0 : __PYX_ERR(0, 804, __pyx_L1_error)
27616 : }
27617 :
27618 : /* "scipy/interpolate/_bspl.pyx":801
27619 : * ):
27620 : * # (A, offset, nc) is a PackedMatrix instance, unpacked
27621 : * qr_reduce(&a[0, 0], a.shape[0], a.shape[1], # <<<<<<<<<<<<<<
27622 : * &offset[0],
27623 : * nc,
27624 : */
27625 430 : try {
27626 430 : fitpack::qr_reduce((&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_a.data + __pyx_t_1 * __pyx_v_a.strides[0]) )) + __pyx_t_2)) )))), (__pyx_v_a.shape[0]), (__pyx_v_a.shape[1]), (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_offset.data) + __pyx_t_4)) )))), __pyx_v_nc, (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_5 * __pyx_v_y.strides[0]) )) + __pyx_t_6)) )))), (__pyx_v_y.shape[1]), __pyx_v_startrow);
27627 0 : } catch(...) {
27628 0 : __Pyx_CppExn2PyErr();
27629 0 : __PYX_ERR(0, 801, __pyx_L1_error)
27630 0 : }
27631 :
27632 : /* "scipy/interpolate/_bspl.pyx":796
27633 : * # wrappers for fitpack repro
27634 : * # ---------------------------
27635 : * def _qr_reduce(double[:, ::1] a, ssize_t[::1] offset, ssize_t nc, # A packed # <<<<<<<<<<<<<<
27636 : * double[:, ::1] y,
27637 : * ssize_t startrow=1
27638 : */
27639 :
27640 : /* function exit code */
27641 430 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27642 430 : goto __pyx_L0;
27643 0 : __pyx_L1_error:;
27644 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._qr_reduce", __pyx_clineno, __pyx_lineno, __pyx_filename);
27645 0 : __pyx_r = NULL;
27646 430 : __pyx_L0:;
27647 430 : __Pyx_XGIVEREF(__pyx_r);
27648 430 : __Pyx_RefNannyFinishContext();
27649 430 : return __pyx_r;
27650 : }
27651 :
27652 : /* "scipy/interpolate/_bspl.pyx":808
27653 : *
27654 : *
27655 : * def _data_matrix(const double[::1] x, # <<<<<<<<<<<<<<
27656 : * const double[::1] t,
27657 : * int k,
27658 : */
27659 :
27660 : /* Python wrapper */
27661 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_19_data_matrix(PyObject *__pyx_self,
27662 : #if CYTHON_METH_FASTCALL
27663 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
27664 : #else
27665 : PyObject *__pyx_args, PyObject *__pyx_kwds
27666 : #endif
27667 : ); /*proto*/
27668 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_19_data_matrix = {"_data_matrix", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_19_data_matrix, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
27669 270 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_19_data_matrix(PyObject *__pyx_self,
27670 : #if CYTHON_METH_FASTCALL
27671 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
27672 : #else
27673 : PyObject *__pyx_args, PyObject *__pyx_kwds
27674 : #endif
27675 : ) {
27676 270 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
27677 270 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
27678 270 : int __pyx_v_k;
27679 270 : __Pyx_memviewslice __pyx_v_w = { 0, 0, { 0 }, { 0 }, { 0 } };
27680 : #if !CYTHON_METH_FASTCALL
27681 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
27682 : #endif
27683 270 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
27684 270 : PyObject* values[4] = {0,0,0,0};
27685 270 : int __pyx_lineno = 0;
27686 270 : const char *__pyx_filename = NULL;
27687 270 : int __pyx_clineno = 0;
27688 270 : PyObject *__pyx_r = 0;
27689 : __Pyx_RefNannyDeclarations
27690 270 : __Pyx_RefNannySetupContext("_data_matrix (wrapper)", 0);
27691 : #if !CYTHON_METH_FASTCALL
27692 : #if CYTHON_ASSUME_SAFE_MACROS
27693 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
27694 : #else
27695 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
27696 : #endif
27697 : #endif
27698 270 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
27699 270 : {
27700 270 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_k,&__pyx_n_s_w,0};
27701 270 : if (__pyx_kwds) {
27702 1 : Py_ssize_t kw_args;
27703 1 : switch (__pyx_nargs) {
27704 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
27705 1 : CYTHON_FALLTHROUGH;
27706 1 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
27707 1 : CYTHON_FALLTHROUGH;
27708 1 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
27709 1 : CYTHON_FALLTHROUGH;
27710 1 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
27711 1 : CYTHON_FALLTHROUGH;
27712 1 : case 0: break;
27713 0 : default: goto __pyx_L5_argtuple_error;
27714 : }
27715 1 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
27716 1 : switch (__pyx_nargs) {
27717 0 : case 0:
27718 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
27719 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
27720 0 : kw_args--;
27721 : }
27722 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L3_error)
27723 0 : else goto __pyx_L5_argtuple_error;
27724 0 : CYTHON_FALLTHROUGH;
27725 0 : case 1:
27726 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
27727 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
27728 0 : kw_args--;
27729 : }
27730 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L3_error)
27731 : else {
27732 0 : __Pyx_RaiseArgtupleInvalid("_data_matrix", 1, 4, 4, 1); __PYX_ERR(0, 808, __pyx_L3_error)
27733 : }
27734 0 : CYTHON_FALLTHROUGH;
27735 0 : case 2:
27736 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
27737 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
27738 0 : kw_args--;
27739 : }
27740 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L3_error)
27741 : else {
27742 0 : __Pyx_RaiseArgtupleInvalid("_data_matrix", 1, 4, 4, 2); __PYX_ERR(0, 808, __pyx_L3_error)
27743 : }
27744 1 : CYTHON_FALLTHROUGH;
27745 1 : case 3:
27746 1 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_w)) != 0)) {
27747 1 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
27748 1 : kw_args--;
27749 : }
27750 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L3_error)
27751 : else {
27752 0 : __Pyx_RaiseArgtupleInvalid("_data_matrix", 1, 4, 4, 3); __PYX_ERR(0, 808, __pyx_L3_error)
27753 : }
27754 : }
27755 1 : if (unlikely(kw_args > 0)) {
27756 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
27757 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_data_matrix") < 0)) __PYX_ERR(0, 808, __pyx_L3_error)
27758 : }
27759 269 : } else if (unlikely(__pyx_nargs != 4)) {
27760 0 : goto __pyx_L5_argtuple_error;
27761 : } else {
27762 269 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
27763 269 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
27764 269 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
27765 269 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
27766 : }
27767 270 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 808, __pyx_L3_error)
27768 270 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 809, __pyx_L3_error)
27769 270 : __pyx_v_k = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 810, __pyx_L3_error)
27770 270 : __pyx_v_w = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[3], 0); if (unlikely(!__pyx_v_w.memview)) __PYX_ERR(0, 811, __pyx_L3_error)
27771 : }
27772 270 : goto __pyx_L6_skip;
27773 0 : __pyx_L5_argtuple_error:;
27774 0 : __Pyx_RaiseArgtupleInvalid("_data_matrix", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 808, __pyx_L3_error)
27775 270 : __pyx_L6_skip:;
27776 270 : goto __pyx_L4_argument_unpacking_done;
27777 0 : __pyx_L3_error:;
27778 0 : {
27779 0 : Py_ssize_t __pyx_temp;
27780 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
27781 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
27782 : }
27783 : }
27784 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
27785 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
27786 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_w, 1);
27787 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._data_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
27788 : __Pyx_RefNannyFinishContext();
27789 : return NULL;
27790 270 : __pyx_L4_argument_unpacking_done:;
27791 270 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_18_data_matrix(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_k, __pyx_v_w);
27792 :
27793 : /* function exit code */
27794 270 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
27795 270 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
27796 270 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_w, 1);
27797 : {
27798 : Py_ssize_t __pyx_temp;
27799 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
27800 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
27801 : }
27802 : }
27803 : __Pyx_RefNannyFinishContext();
27804 : return __pyx_r;
27805 : }
27806 :
27807 270 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_18_data_matrix(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, __Pyx_memviewslice __pyx_v_w) {
27808 270 : Py_ssize_t __pyx_v_m;
27809 270 : __Pyx_memviewslice __pyx_v_A = { 0, 0, { 0 }, { 0 }, { 0 } };
27810 270 : __Pyx_memviewslice __pyx_v_offset = { 0, 0, { 0 }, { 0 }, { 0 } };
27811 270 : __Pyx_memviewslice __pyx_v_wrk = { 0, 0, { 0 }, { 0 }, { 0 } };
27812 270 : Py_ssize_t __pyx_v_nc;
27813 270 : PyObject *__pyx_r = NULL;
27814 : __Pyx_RefNannyDeclarations
27815 270 : PyObject *__pyx_t_1 = NULL;
27816 270 : PyObject *__pyx_t_2 = NULL;
27817 270 : PyObject *__pyx_t_3 = NULL;
27818 270 : PyObject *__pyx_t_4 = NULL;
27819 270 : __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
27820 270 : PyObject *__pyx_t_6 = NULL;
27821 270 : __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
27822 270 : __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
27823 270 : int __pyx_t_9;
27824 270 : Py_ssize_t __pyx_t_10;
27825 270 : Py_UCS4 __pyx_t_11;
27826 270 : Py_ssize_t __pyx_t_12;
27827 270 : Py_ssize_t __pyx_t_13;
27828 270 : int __pyx_t_14;
27829 270 : Py_ssize_t __pyx_t_15;
27830 270 : Py_ssize_t __pyx_t_16;
27831 270 : Py_ssize_t __pyx_t_17;
27832 270 : Py_ssize_t __pyx_t_18;
27833 270 : Py_ssize_t __pyx_t_19;
27834 270 : Py_ssize_t __pyx_t_20;
27835 270 : unsigned int __pyx_t_21;
27836 270 : int __pyx_lineno = 0;
27837 270 : const char *__pyx_filename = NULL;
27838 270 : int __pyx_clineno = 0;
27839 270 : __Pyx_RefNannySetupContext("_data_matrix", 1);
27840 :
27841 : /* "scipy/interpolate/_bspl.pyx":813
27842 : * const double[::1] w):
27843 : * cdef:
27844 : * ssize_t m = x.shape[0] # <<<<<<<<<<<<<<
27845 : * double[:, ::1] A = np.empty((m, k+1), dtype=float)
27846 : * ssize_t[::1] offset = np.zeros(m, dtype=np.intp)
27847 : */
27848 270 : __pyx_v_m = (__pyx_v_x.shape[0]);
27849 :
27850 : /* "scipy/interpolate/_bspl.pyx":814
27851 : * cdef:
27852 : * ssize_t m = x.shape[0]
27853 : * double[:, ::1] A = np.empty((m, k+1), dtype=float) # <<<<<<<<<<<<<<
27854 : * ssize_t[::1] offset = np.zeros(m, dtype=np.intp)
27855 : * double[::1] wrk = np.empty(2*k+2, dtype=float)
27856 : */
27857 270 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
27858 270 : __Pyx_GOTREF(__pyx_t_1);
27859 270 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error)
27860 270 : __Pyx_GOTREF(__pyx_t_2);
27861 270 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27862 270 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
27863 270 : __Pyx_GOTREF(__pyx_t_1);
27864 270 : __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error)
27865 270 : __Pyx_GOTREF(__pyx_t_3);
27866 270 : __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 814, __pyx_L1_error)
27867 270 : __Pyx_GOTREF(__pyx_t_4);
27868 270 : __Pyx_GIVEREF(__pyx_t_1);
27869 270 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error);
27870 270 : __Pyx_GIVEREF(__pyx_t_3);
27871 270 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error);
27872 270 : __pyx_t_1 = 0;
27873 270 : __pyx_t_3 = 0;
27874 270 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error)
27875 270 : __Pyx_GOTREF(__pyx_t_3);
27876 270 : __Pyx_GIVEREF(__pyx_t_4);
27877 270 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 814, __pyx_L1_error);
27878 270 : __pyx_t_4 = 0;
27879 270 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 814, __pyx_L1_error)
27880 270 : __Pyx_GOTREF(__pyx_t_4);
27881 270 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 814, __pyx_L1_error)
27882 270 : __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
27883 270 : __Pyx_GOTREF(__pyx_t_1);
27884 270 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27885 270 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27886 270 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27887 270 : __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 814, __pyx_L1_error)
27888 270 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27889 270 : __pyx_v_A = __pyx_t_5;
27890 270 : __pyx_t_5.memview = NULL;
27891 270 : __pyx_t_5.data = NULL;
27892 :
27893 : /* "scipy/interpolate/_bspl.pyx":815
27894 : * ssize_t m = x.shape[0]
27895 : * double[:, ::1] A = np.empty((m, k+1), dtype=float)
27896 : * ssize_t[::1] offset = np.zeros(m, dtype=np.intp) # <<<<<<<<<<<<<<
27897 : * double[::1] wrk = np.empty(2*k+2, dtype=float)
27898 : * ssize_t nc
27899 : */
27900 270 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
27901 270 : __Pyx_GOTREF(__pyx_t_1);
27902 270 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 815, __pyx_L1_error)
27903 270 : __Pyx_GOTREF(__pyx_t_4);
27904 270 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27905 270 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
27906 270 : __Pyx_GOTREF(__pyx_t_1);
27907 270 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 815, __pyx_L1_error)
27908 270 : __Pyx_GOTREF(__pyx_t_3);
27909 270 : __Pyx_GIVEREF(__pyx_t_1);
27910 270 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error);
27911 270 : __pyx_t_1 = 0;
27912 270 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 815, __pyx_L1_error)
27913 270 : __Pyx_GOTREF(__pyx_t_1);
27914 270 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 815, __pyx_L1_error)
27915 270 : __Pyx_GOTREF(__pyx_t_2);
27916 270 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 815, __pyx_L1_error)
27917 270 : __Pyx_GOTREF(__pyx_t_6);
27918 270 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27919 270 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 815, __pyx_L1_error)
27920 270 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27921 270 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 815, __pyx_L1_error)
27922 270 : __Pyx_GOTREF(__pyx_t_6);
27923 270 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27924 270 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27925 270 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27926 270 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 815, __pyx_L1_error)
27927 270 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27928 270 : __pyx_v_offset = __pyx_t_7;
27929 270 : __pyx_t_7.memview = NULL;
27930 270 : __pyx_t_7.data = NULL;
27931 :
27932 : /* "scipy/interpolate/_bspl.pyx":816
27933 : * double[:, ::1] A = np.empty((m, k+1), dtype=float)
27934 : * ssize_t[::1] offset = np.zeros(m, dtype=np.intp)
27935 : * double[::1] wrk = np.empty(2*k+2, dtype=float) # <<<<<<<<<<<<<<
27936 : * ssize_t nc
27937 : *
27938 : */
27939 270 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 816, __pyx_L1_error)
27940 270 : __Pyx_GOTREF(__pyx_t_6);
27941 270 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
27942 270 : __Pyx_GOTREF(__pyx_t_1);
27943 270 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27944 270 : __pyx_t_6 = __Pyx_PyInt_From_long(((2 * __pyx_v_k) + 2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 816, __pyx_L1_error)
27945 270 : __Pyx_GOTREF(__pyx_t_6);
27946 270 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error)
27947 270 : __Pyx_GOTREF(__pyx_t_3);
27948 270 : __Pyx_GIVEREF(__pyx_t_6);
27949 270 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 816, __pyx_L1_error);
27950 270 : __pyx_t_6 = 0;
27951 270 : __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 816, __pyx_L1_error)
27952 270 : __Pyx_GOTREF(__pyx_t_6);
27953 270 : if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, ((PyObject *)(&PyFloat_Type))) < 0) __PYX_ERR(0, 816, __pyx_L1_error)
27954 270 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error)
27955 270 : __Pyx_GOTREF(__pyx_t_4);
27956 270 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27957 270 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27958 270 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27959 270 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 816, __pyx_L1_error)
27960 270 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27961 270 : __pyx_v_wrk = __pyx_t_8;
27962 270 : __pyx_t_8.memview = NULL;
27963 270 : __pyx_t_8.data = NULL;
27964 :
27965 : /* "scipy/interpolate/_bspl.pyx":819
27966 : * ssize_t nc
27967 : *
27968 : * if w.shape[0] != x.shape[0]: # <<<<<<<<<<<<<<
27969 : * raise ValueError(f"{len(w) =} != {len(x) =}.")
27970 : *
27971 : */
27972 270 : __pyx_t_9 = ((__pyx_v_w.shape[0]) != (__pyx_v_x.shape[0]));
27973 270 : if (unlikely(__pyx_t_9)) {
27974 :
27975 : /* "scipy/interpolate/_bspl.pyx":820
27976 : *
27977 : * if w.shape[0] != x.shape[0]:
27978 : * raise ValueError(f"{len(w) =} != {len(x) =}.") # <<<<<<<<<<<<<<
27979 : *
27980 : * data_matrix(&x[0], m,
27981 : */
27982 0 : __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error)
27983 0 : __Pyx_GOTREF(__pyx_t_4);
27984 0 : __pyx_t_10 = 0;
27985 0 : __pyx_t_11 = 127;
27986 0 : __Pyx_INCREF(__pyx_kp_u_len_w);
27987 0 : __pyx_t_10 += 8;
27988 0 : __Pyx_GIVEREF(__pyx_kp_u_len_w);
27989 0 : PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_len_w);
27990 0 : __pyx_t_12 = __Pyx_MemoryView_Len(__pyx_v_w);
27991 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_12, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
27992 0 : __Pyx_GOTREF(__pyx_t_6);
27993 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
27994 0 : __Pyx_GIVEREF(__pyx_t_6);
27995 0 : PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
27996 0 : __pyx_t_6 = 0;
27997 0 : __Pyx_INCREF(__pyx_kp_u_len_x);
27998 0 : __pyx_t_10 += 12;
27999 0 : __Pyx_GIVEREF(__pyx_kp_u_len_x);
28000 0 : PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_len_x);
28001 0 : __pyx_t_12 = __Pyx_MemoryView_Len(__pyx_v_x);
28002 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_12, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
28003 0 : __Pyx_GOTREF(__pyx_t_6);
28004 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
28005 0 : __Pyx_GIVEREF(__pyx_t_6);
28006 0 : PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_6);
28007 0 : __pyx_t_6 = 0;
28008 0 : __Pyx_INCREF(__pyx_kp_u__2);
28009 0 : __pyx_t_10 += 1;
28010 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
28011 0 : PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__2);
28012 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 820, __pyx_L1_error)
28013 0 : __Pyx_GOTREF(__pyx_t_6);
28014 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28015 0 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error)
28016 0 : __Pyx_GOTREF(__pyx_t_4);
28017 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28018 0 : __Pyx_Raise(__pyx_t_4, 0, 0, 0);
28019 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28020 0 : __PYX_ERR(0, 820, __pyx_L1_error)
28021 :
28022 : /* "scipy/interpolate/_bspl.pyx":819
28023 : * ssize_t nc
28024 : *
28025 : * if w.shape[0] != x.shape[0]: # <<<<<<<<<<<<<<
28026 : * raise ValueError(f"{len(w) =} != {len(x) =}.")
28027 : *
28028 : */
28029 : }
28030 :
28031 : /* "scipy/interpolate/_bspl.pyx":822
28032 : * raise ValueError(f"{len(w) =} != {len(x) =}.")
28033 : *
28034 : * data_matrix(&x[0], m, # <<<<<<<<<<<<<<
28035 : * &t[0], t.shape[0],
28036 : * k,
28037 : */
28038 270 : __pyx_t_13 = 0;
28039 270 : __pyx_t_14 = -1;
28040 270 : if (__pyx_t_13 < 0) {
28041 : __pyx_t_13 += __pyx_v_x.shape[0];
28042 : if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
28043 270 : } else if (unlikely(__pyx_t_13 >= __pyx_v_x.shape[0])) __pyx_t_14 = 0;
28044 270 : if (unlikely(__pyx_t_14 != -1)) {
28045 0 : __Pyx_RaiseBufferIndexError(__pyx_t_14);
28046 0 : __PYX_ERR(0, 822, __pyx_L1_error)
28047 : }
28048 :
28049 : /* "scipy/interpolate/_bspl.pyx":823
28050 : *
28051 : * data_matrix(&x[0], m,
28052 : * &t[0], t.shape[0], # <<<<<<<<<<<<<<
28053 : * k,
28054 : * &w[0],
28055 : */
28056 270 : __pyx_t_15 = 0;
28057 270 : __pyx_t_14 = -1;
28058 270 : if (__pyx_t_15 < 0) {
28059 : __pyx_t_15 += __pyx_v_t.shape[0];
28060 : if (unlikely(__pyx_t_15 < 0)) __pyx_t_14 = 0;
28061 270 : } else if (unlikely(__pyx_t_15 >= __pyx_v_t.shape[0])) __pyx_t_14 = 0;
28062 270 : if (unlikely(__pyx_t_14 != -1)) {
28063 0 : __Pyx_RaiseBufferIndexError(__pyx_t_14);
28064 0 : __PYX_ERR(0, 823, __pyx_L1_error)
28065 : }
28066 :
28067 : /* "scipy/interpolate/_bspl.pyx":825
28068 : * &t[0], t.shape[0],
28069 : * k,
28070 : * &w[0], # <<<<<<<<<<<<<<
28071 : * &A[0, 0], # output: (A, offset, nc)
28072 : * &offset[0],
28073 : */
28074 270 : __pyx_t_16 = 0;
28075 270 : __pyx_t_14 = -1;
28076 270 : if (__pyx_t_16 < 0) {
28077 : __pyx_t_16 += __pyx_v_w.shape[0];
28078 : if (unlikely(__pyx_t_16 < 0)) __pyx_t_14 = 0;
28079 270 : } else if (unlikely(__pyx_t_16 >= __pyx_v_w.shape[0])) __pyx_t_14 = 0;
28080 270 : if (unlikely(__pyx_t_14 != -1)) {
28081 0 : __Pyx_RaiseBufferIndexError(__pyx_t_14);
28082 0 : __PYX_ERR(0, 825, __pyx_L1_error)
28083 : }
28084 :
28085 : /* "scipy/interpolate/_bspl.pyx":826
28086 : * k,
28087 : * &w[0],
28088 : * &A[0, 0], # output: (A, offset, nc) # <<<<<<<<<<<<<<
28089 : * &offset[0],
28090 : * &nc,
28091 : */
28092 270 : __pyx_t_17 = 0;
28093 270 : __pyx_t_18 = 0;
28094 270 : __pyx_t_14 = -1;
28095 270 : if (__pyx_t_17 < 0) {
28096 : __pyx_t_17 += __pyx_v_A.shape[0];
28097 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_14 = 0;
28098 270 : } else if (unlikely(__pyx_t_17 >= __pyx_v_A.shape[0])) __pyx_t_14 = 0;
28099 270 : if (__pyx_t_18 < 0) {
28100 : __pyx_t_18 += __pyx_v_A.shape[1];
28101 : if (unlikely(__pyx_t_18 < 0)) __pyx_t_14 = 1;
28102 270 : } else if (unlikely(__pyx_t_18 >= __pyx_v_A.shape[1])) __pyx_t_14 = 1;
28103 270 : if (unlikely(__pyx_t_14 != -1)) {
28104 0 : __Pyx_RaiseBufferIndexError(__pyx_t_14);
28105 0 : __PYX_ERR(0, 826, __pyx_L1_error)
28106 : }
28107 :
28108 : /* "scipy/interpolate/_bspl.pyx":827
28109 : * &w[0],
28110 : * &A[0, 0], # output: (A, offset, nc)
28111 : * &offset[0], # <<<<<<<<<<<<<<
28112 : * &nc,
28113 : * &wrk[0], # work array
28114 : */
28115 270 : __pyx_t_19 = 0;
28116 270 : __pyx_t_14 = -1;
28117 270 : if (__pyx_t_19 < 0) {
28118 : __pyx_t_19 += __pyx_v_offset.shape[0];
28119 : if (unlikely(__pyx_t_19 < 0)) __pyx_t_14 = 0;
28120 270 : } else if (unlikely(__pyx_t_19 >= __pyx_v_offset.shape[0])) __pyx_t_14 = 0;
28121 270 : if (unlikely(__pyx_t_14 != -1)) {
28122 0 : __Pyx_RaiseBufferIndexError(__pyx_t_14);
28123 0 : __PYX_ERR(0, 827, __pyx_L1_error)
28124 : }
28125 :
28126 : /* "scipy/interpolate/_bspl.pyx":829
28127 : * &offset[0],
28128 : * &nc,
28129 : * &wrk[0], # work array # <<<<<<<<<<<<<<
28130 : * )
28131 : * return np.asarray(A), np.asarray(offset), int(nc)
28132 : */
28133 270 : __pyx_t_20 = 0;
28134 270 : __pyx_t_14 = -1;
28135 270 : if (__pyx_t_20 < 0) {
28136 : __pyx_t_20 += __pyx_v_wrk.shape[0];
28137 : if (unlikely(__pyx_t_20 < 0)) __pyx_t_14 = 0;
28138 270 : } else if (unlikely(__pyx_t_20 >= __pyx_v_wrk.shape[0])) __pyx_t_14 = 0;
28139 270 : if (unlikely(__pyx_t_14 != -1)) {
28140 0 : __Pyx_RaiseBufferIndexError(__pyx_t_14);
28141 0 : __PYX_ERR(0, 829, __pyx_L1_error)
28142 : }
28143 :
28144 : /* "scipy/interpolate/_bspl.pyx":822
28145 : * raise ValueError(f"{len(w) =} != {len(x) =}.")
28146 : *
28147 : * data_matrix(&x[0], m, # <<<<<<<<<<<<<<
28148 : * &t[0], t.shape[0],
28149 : * k,
28150 : */
28151 270 : try {
28152 270 : fitpack::data_matrix((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_x.data) + __pyx_t_13)) )))), __pyx_v_m, (&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_15)) )))), (__pyx_v_t.shape[0]), __pyx_v_k, (&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_w.data) + __pyx_t_16)) )))), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_A.data + __pyx_t_17 * __pyx_v_A.strides[0]) )) + __pyx_t_18)) )))), (&(*((Py_ssize_t *) ( /* dim=0 */ ((char *) (((Py_ssize_t *) __pyx_v_offset.data) + __pyx_t_19)) )))), ((Py_ssize_t *)(&__pyx_v_nc)), (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_wrk.data) + __pyx_t_20)) )))));
28153 0 : } catch(...) {
28154 0 : __Pyx_CppExn2PyErr();
28155 0 : __PYX_ERR(0, 822, __pyx_L1_error)
28156 0 : }
28157 :
28158 : /* "scipy/interpolate/_bspl.pyx":831
28159 : * &wrk[0], # work array
28160 : * )
28161 : * return np.asarray(A), np.asarray(offset), int(nc) # <<<<<<<<<<<<<<
28162 : *
28163 : *
28164 : */
28165 270 : __Pyx_XDECREF(__pyx_r);
28166 270 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
28167 270 : __Pyx_GOTREF(__pyx_t_6);
28168 270 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error)
28169 270 : __Pyx_GOTREF(__pyx_t_3);
28170 270 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28171 270 : __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_A, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
28172 270 : __Pyx_GOTREF(__pyx_t_6);
28173 270 : __pyx_t_1 = NULL;
28174 270 : __pyx_t_21 = 0;
28175 : #if CYTHON_UNPACK_METHODS
28176 270 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
28177 0 : __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
28178 0 : if (likely(__pyx_t_1)) {
28179 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
28180 0 : __Pyx_INCREF(__pyx_t_1);
28181 0 : __Pyx_INCREF(function);
28182 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
28183 : __pyx_t_21 = 1;
28184 : }
28185 : }
28186 : #endif
28187 270 : {
28188 270 : PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_6};
28189 270 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_21, 1+__pyx_t_21);
28190 270 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28191 270 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28192 270 : if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error)
28193 270 : __Pyx_GOTREF(__pyx_t_4);
28194 270 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28195 : }
28196 270 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
28197 270 : __Pyx_GOTREF(__pyx_t_6);
28198 270 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
28199 270 : __Pyx_GOTREF(__pyx_t_1);
28200 270 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28201 270 : __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_offset, 1, (PyObject *(*)(char *)) __pyx_memview_get_Py_ssize_t, (int (*)(char *, PyObject *)) __pyx_memview_set_Py_ssize_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
28202 270 : __Pyx_GOTREF(__pyx_t_6);
28203 270 : __pyx_t_2 = NULL;
28204 270 : __pyx_t_21 = 0;
28205 : #if CYTHON_UNPACK_METHODS
28206 270 : if (unlikely(PyMethod_Check(__pyx_t_1))) {
28207 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
28208 0 : if (likely(__pyx_t_2)) {
28209 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
28210 0 : __Pyx_INCREF(__pyx_t_2);
28211 0 : __Pyx_INCREF(function);
28212 0 : __Pyx_DECREF_SET(__pyx_t_1, function);
28213 : __pyx_t_21 = 1;
28214 : }
28215 : }
28216 : #endif
28217 270 : {
28218 270 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_6};
28219 270 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_21, 1+__pyx_t_21);
28220 270 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
28221 270 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28222 270 : if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error)
28223 270 : __Pyx_GOTREF(__pyx_t_3);
28224 270 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28225 : }
28226 270 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_nc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
28227 270 : __Pyx_GOTREF(__pyx_t_1);
28228 270 : __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
28229 270 : __Pyx_GOTREF(__pyx_t_6);
28230 270 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28231 270 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
28232 270 : __Pyx_GOTREF(__pyx_t_1);
28233 270 : __Pyx_GIVEREF(__pyx_t_4);
28234 270 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error);
28235 270 : __Pyx_GIVEREF(__pyx_t_3);
28236 270 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error);
28237 270 : __Pyx_GIVEREF(__pyx_t_6);
28238 270 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error);
28239 270 : __pyx_t_4 = 0;
28240 270 : __pyx_t_3 = 0;
28241 270 : __pyx_t_6 = 0;
28242 270 : __pyx_r = __pyx_t_1;
28243 270 : __pyx_t_1 = 0;
28244 270 : goto __pyx_L0;
28245 :
28246 : /* "scipy/interpolate/_bspl.pyx":808
28247 : *
28248 : *
28249 : * def _data_matrix(const double[::1] x, # <<<<<<<<<<<<<<
28250 : * const double[::1] t,
28251 : * int k,
28252 : */
28253 :
28254 : /* function exit code */
28255 0 : __pyx_L1_error:;
28256 0 : __Pyx_XDECREF(__pyx_t_1);
28257 0 : __Pyx_XDECREF(__pyx_t_2);
28258 0 : __Pyx_XDECREF(__pyx_t_3);
28259 0 : __Pyx_XDECREF(__pyx_t_4);
28260 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_5, 1);
28261 0 : __Pyx_XDECREF(__pyx_t_6);
28262 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
28263 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
28264 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._data_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
28265 : __pyx_r = NULL;
28266 270 : __pyx_L0:;
28267 270 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_A, 1);
28268 270 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_offset, 1);
28269 270 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_wrk, 1);
28270 270 : __Pyx_XGIVEREF(__pyx_r);
28271 270 : __Pyx_RefNannyFinishContext();
28272 270 : return __pyx_r;
28273 : }
28274 :
28275 : /* "scipy/interpolate/_bspl.pyx":834
28276 : *
28277 : *
28278 : * def _fpback(const double[:, ::1] R, ssize_t nc, # (R, offset, nc) triangular => offset is range(nc) # <<<<<<<<<<<<<<
28279 : * const double[:, ::1] y
28280 : * ):
28281 : */
28282 :
28283 : /* Python wrapper */
28284 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_21_fpback(PyObject *__pyx_self,
28285 : #if CYTHON_METH_FASTCALL
28286 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
28287 : #else
28288 : PyObject *__pyx_args, PyObject *__pyx_kwds
28289 : #endif
28290 : ); /*proto*/
28291 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_21_fpback = {"_fpback", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_21_fpback, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
28292 429 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_21_fpback(PyObject *__pyx_self,
28293 : #if CYTHON_METH_FASTCALL
28294 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
28295 : #else
28296 : PyObject *__pyx_args, PyObject *__pyx_kwds
28297 : #endif
28298 : ) {
28299 429 : __Pyx_memviewslice __pyx_v_R = { 0, 0, { 0 }, { 0 }, { 0 } };
28300 429 : Py_ssize_t __pyx_v_nc;
28301 429 : __Pyx_memviewslice __pyx_v_y = { 0, 0, { 0 }, { 0 }, { 0 } };
28302 : #if !CYTHON_METH_FASTCALL
28303 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
28304 : #endif
28305 429 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
28306 429 : PyObject* values[3] = {0,0,0};
28307 429 : int __pyx_lineno = 0;
28308 429 : const char *__pyx_filename = NULL;
28309 429 : int __pyx_clineno = 0;
28310 429 : PyObject *__pyx_r = 0;
28311 : __Pyx_RefNannyDeclarations
28312 429 : __Pyx_RefNannySetupContext("_fpback (wrapper)", 0);
28313 : #if !CYTHON_METH_FASTCALL
28314 : #if CYTHON_ASSUME_SAFE_MACROS
28315 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
28316 : #else
28317 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
28318 : #endif
28319 : #endif
28320 429 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
28321 429 : {
28322 429 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_nc,&__pyx_n_s_y,0};
28323 429 : if (__pyx_kwds) {
28324 0 : Py_ssize_t kw_args;
28325 0 : switch (__pyx_nargs) {
28326 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
28327 0 : CYTHON_FALLTHROUGH;
28328 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
28329 0 : CYTHON_FALLTHROUGH;
28330 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
28331 0 : CYTHON_FALLTHROUGH;
28332 0 : case 0: break;
28333 0 : default: goto __pyx_L5_argtuple_error;
28334 : }
28335 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
28336 0 : switch (__pyx_nargs) {
28337 0 : case 0:
28338 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_R)) != 0)) {
28339 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
28340 0 : kw_args--;
28341 : }
28342 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L3_error)
28343 0 : else goto __pyx_L5_argtuple_error;
28344 0 : CYTHON_FALLTHROUGH;
28345 0 : case 1:
28346 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_nc)) != 0)) {
28347 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
28348 0 : kw_args--;
28349 : }
28350 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L3_error)
28351 : else {
28352 0 : __Pyx_RaiseArgtupleInvalid("_fpback", 1, 3, 3, 1); __PYX_ERR(0, 834, __pyx_L3_error)
28353 : }
28354 0 : CYTHON_FALLTHROUGH;
28355 0 : case 2:
28356 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) {
28357 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
28358 0 : kw_args--;
28359 : }
28360 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L3_error)
28361 : else {
28362 0 : __Pyx_RaiseArgtupleInvalid("_fpback", 1, 3, 3, 2); __PYX_ERR(0, 834, __pyx_L3_error)
28363 : }
28364 : }
28365 0 : if (unlikely(kw_args > 0)) {
28366 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
28367 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_fpback") < 0)) __PYX_ERR(0, 834, __pyx_L3_error)
28368 : }
28369 429 : } else if (unlikely(__pyx_nargs != 3)) {
28370 0 : goto __pyx_L5_argtuple_error;
28371 : } else {
28372 429 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
28373 429 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
28374 429 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
28375 : }
28376 429 : __pyx_v_R = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_R.memview)) __PYX_ERR(0, 834, __pyx_L3_error)
28377 429 : __pyx_v_nc = PyInt_AsSsize_t(values[1]); if (unlikely((__pyx_v_nc == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L3_error)
28378 429 : __pyx_v_y = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(values[2], 0); if (unlikely(!__pyx_v_y.memview)) __PYX_ERR(0, 835, __pyx_L3_error)
28379 : }
28380 429 : goto __pyx_L6_skip;
28381 0 : __pyx_L5_argtuple_error:;
28382 0 : __Pyx_RaiseArgtupleInvalid("_fpback", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 834, __pyx_L3_error)
28383 429 : __pyx_L6_skip:;
28384 429 : goto __pyx_L4_argument_unpacking_done;
28385 0 : __pyx_L3_error:;
28386 0 : {
28387 0 : Py_ssize_t __pyx_temp;
28388 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
28389 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
28390 : }
28391 : }
28392 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_R, 1);
28393 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
28394 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._fpback", __pyx_clineno, __pyx_lineno, __pyx_filename);
28395 : __Pyx_RefNannyFinishContext();
28396 : return NULL;
28397 429 : __pyx_L4_argument_unpacking_done:;
28398 429 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_20_fpback(__pyx_self, __pyx_v_R, __pyx_v_nc, __pyx_v_y);
28399 :
28400 : /* function exit code */
28401 429 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_R, 1);
28402 429 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_y, 1);
28403 : {
28404 : Py_ssize_t __pyx_temp;
28405 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
28406 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
28407 : }
28408 : }
28409 : __Pyx_RefNannyFinishContext();
28410 : return __pyx_r;
28411 : }
28412 :
28413 429 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_20_fpback(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_R, Py_ssize_t __pyx_v_nc, __Pyx_memviewslice __pyx_v_y) {
28414 429 : Py_ssize_t __pyx_v_m;
28415 429 : Py_ssize_t __pyx_v_nz;
28416 429 : __Pyx_memviewslice __pyx_v_c = { 0, 0, { 0 }, { 0 }, { 0 } };
28417 429 : PyObject *__pyx_r = NULL;
28418 : __Pyx_RefNannyDeclarations
28419 429 : int __pyx_t_1;
28420 429 : PyObject *__pyx_t_2 = NULL;
28421 429 : Py_ssize_t __pyx_t_3;
28422 429 : Py_UCS4 __pyx_t_4;
28423 429 : PyObject *__pyx_t_5 = NULL;
28424 429 : PyObject *__pyx_t_6 = NULL;
28425 429 : __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
28426 429 : int __pyx_t_8;
28427 429 : PyObject *__pyx_t_9 = NULL;
28428 429 : unsigned int __pyx_t_10;
28429 429 : __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
28430 429 : Py_ssize_t __pyx_t_12;
28431 429 : Py_ssize_t __pyx_t_13;
28432 429 : Py_ssize_t __pyx_t_14;
28433 429 : Py_ssize_t __pyx_t_15;
28434 429 : Py_ssize_t __pyx_t_16;
28435 429 : Py_ssize_t __pyx_t_17;
28436 429 : int __pyx_lineno = 0;
28437 429 : const char *__pyx_filename = NULL;
28438 429 : int __pyx_clineno = 0;
28439 429 : __Pyx_RefNannySetupContext("_fpback", 1);
28440 :
28441 : /* "scipy/interpolate/_bspl.pyx":838
28442 : * ):
28443 : * cdef:
28444 : * ssize_t m = R.shape[0] # <<<<<<<<<<<<<<
28445 : * ssize_t nz = R.shape[1]
28446 : *
28447 : */
28448 429 : __pyx_v_m = (__pyx_v_R.shape[0]);
28449 :
28450 : /* "scipy/interpolate/_bspl.pyx":839
28451 : * cdef:
28452 : * ssize_t m = R.shape[0]
28453 : * ssize_t nz = R.shape[1] # <<<<<<<<<<<<<<
28454 : *
28455 : * if y.shape[0] != m:
28456 : */
28457 429 : __pyx_v_nz = (__pyx_v_R.shape[1]);
28458 :
28459 : /* "scipy/interpolate/_bspl.pyx":841
28460 : * ssize_t nz = R.shape[1]
28461 : *
28462 : * if y.shape[0] != m: # <<<<<<<<<<<<<<
28463 : * raise ValueError(f"{y.shape = } != {m =}.")
28464 : * if nc > m:
28465 : */
28466 429 : __pyx_t_1 = ((__pyx_v_y.shape[0]) != __pyx_v_m);
28467 429 : if (unlikely(__pyx_t_1)) {
28468 :
28469 : /* "scipy/interpolate/_bspl.pyx":842
28470 : *
28471 : * if y.shape[0] != m:
28472 : * raise ValueError(f"{y.shape = } != {m =}.") # <<<<<<<<<<<<<<
28473 : * if nc > m:
28474 : * raise ValueError(f"{nc = } > {m = }.")
28475 : */
28476 0 : __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
28477 0 : __Pyx_GOTREF(__pyx_t_2);
28478 0 : __pyx_t_3 = 0;
28479 0 : __pyx_t_4 = 127;
28480 0 : __Pyx_INCREF(__pyx_kp_u_y_shape);
28481 0 : __pyx_t_3 += 10;
28482 0 : __Pyx_GIVEREF(__pyx_kp_u_y_shape);
28483 0 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_y_shape);
28484 0 : __pyx_t_5 = __Pyx_carray_to_py_Py_ssize_t(__pyx_v_y.shape, 8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
28485 0 : __Pyx_GOTREF(__pyx_t_5);
28486 0 : __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error)
28487 0 : __Pyx_GOTREF(__pyx_t_6);
28488 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28489 0 : __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_4;
28490 0 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
28491 0 : __Pyx_GIVEREF(__pyx_t_6);
28492 0 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
28493 0 : __pyx_t_6 = 0;
28494 0 : __Pyx_INCREF(__pyx_kp_u_m_2);
28495 0 : __pyx_t_3 += 7;
28496 0 : __Pyx_GIVEREF(__pyx_kp_u_m_2);
28497 0 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_m_2);
28498 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_m, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error)
28499 0 : __Pyx_GOTREF(__pyx_t_6);
28500 0 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
28501 0 : __Pyx_GIVEREF(__pyx_t_6);
28502 0 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
28503 0 : __pyx_t_6 = 0;
28504 0 : __Pyx_INCREF(__pyx_kp_u__2);
28505 0 : __pyx_t_3 += 1;
28506 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
28507 0 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__2);
28508 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 842, __pyx_L1_error)
28509 0 : __Pyx_GOTREF(__pyx_t_6);
28510 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28511 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 842, __pyx_L1_error)
28512 0 : __Pyx_GOTREF(__pyx_t_2);
28513 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28514 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
28515 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28516 0 : __PYX_ERR(0, 842, __pyx_L1_error)
28517 :
28518 : /* "scipy/interpolate/_bspl.pyx":841
28519 : * ssize_t nz = R.shape[1]
28520 : *
28521 : * if y.shape[0] != m: # <<<<<<<<<<<<<<
28522 : * raise ValueError(f"{y.shape = } != {m =}.")
28523 : * if nc > m:
28524 : */
28525 : }
28526 :
28527 : /* "scipy/interpolate/_bspl.pyx":843
28528 : * if y.shape[0] != m:
28529 : * raise ValueError(f"{y.shape = } != {m =}.")
28530 : * if nc > m: # <<<<<<<<<<<<<<
28531 : * raise ValueError(f"{nc = } > {m = }.")
28532 : *
28533 : */
28534 429 : __pyx_t_1 = (__pyx_v_nc > __pyx_v_m);
28535 429 : if (unlikely(__pyx_t_1)) {
28536 :
28537 : /* "scipy/interpolate/_bspl.pyx":844
28538 : * raise ValueError(f"{y.shape = } != {m =}.")
28539 : * if nc > m:
28540 : * raise ValueError(f"{nc = } > {m = }.") # <<<<<<<<<<<<<<
28541 : *
28542 : * cdef double[:, ::1] c = np.empty_like(y[:nc, :])
28543 : */
28544 3 : __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error)
28545 3 : __Pyx_GOTREF(__pyx_t_2);
28546 3 : __pyx_t_3 = 0;
28547 3 : __pyx_t_4 = 127;
28548 3 : __Pyx_INCREF(__pyx_kp_u_nc_2);
28549 3 : __pyx_t_3 += 5;
28550 3 : __Pyx_GIVEREF(__pyx_kp_u_nc_2);
28551 3 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_nc_2);
28552 3 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_nc, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 844, __pyx_L1_error)
28553 3 : __Pyx_GOTREF(__pyx_t_6);
28554 3 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
28555 3 : __Pyx_GIVEREF(__pyx_t_6);
28556 3 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
28557 3 : __pyx_t_6 = 0;
28558 3 : __Pyx_INCREF(__pyx_kp_u_m_3);
28559 3 : __pyx_t_3 += 7;
28560 3 : __Pyx_GIVEREF(__pyx_kp_u_m_3);
28561 3 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_m_3);
28562 3 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_m, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 844, __pyx_L1_error)
28563 3 : __Pyx_GOTREF(__pyx_t_6);
28564 3 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
28565 3 : __Pyx_GIVEREF(__pyx_t_6);
28566 3 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
28567 3 : __pyx_t_6 = 0;
28568 3 : __Pyx_INCREF(__pyx_kp_u__2);
28569 3 : __pyx_t_3 += 1;
28570 3 : __Pyx_GIVEREF(__pyx_kp_u__2);
28571 3 : PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__2);
28572 3 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 844, __pyx_L1_error)
28573 3 : __Pyx_GOTREF(__pyx_t_6);
28574 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28575 3 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error)
28576 3 : __Pyx_GOTREF(__pyx_t_2);
28577 3 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28578 3 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
28579 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28580 3 : __PYX_ERR(0, 844, __pyx_L1_error)
28581 :
28582 : /* "scipy/interpolate/_bspl.pyx":843
28583 : * if y.shape[0] != m:
28584 : * raise ValueError(f"{y.shape = } != {m =}.")
28585 : * if nc > m: # <<<<<<<<<<<<<<
28586 : * raise ValueError(f"{nc = } > {m = }.")
28587 : *
28588 : */
28589 : }
28590 :
28591 : /* "scipy/interpolate/_bspl.pyx":846
28592 : * raise ValueError(f"{nc = } > {m = }.")
28593 : *
28594 : * cdef double[:, ::1] c = np.empty_like(y[:nc, :]) # <<<<<<<<<<<<<<
28595 : *
28596 : * fpback(&R[0, 0], m, nz,
28597 : */
28598 426 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 846, __pyx_L1_error)
28599 426 : __Pyx_GOTREF(__pyx_t_6);
28600 426 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty_like); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L1_error)
28601 426 : __Pyx_GOTREF(__pyx_t_5);
28602 426 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28603 426 : __pyx_t_7.data = __pyx_v_y.data;
28604 426 : __pyx_t_7.memview = __pyx_v_y.memview;
28605 426 : __PYX_INC_MEMVIEW(&__pyx_t_7, 1);
28606 426 : __pyx_t_8 = -1;
28607 426 : if (unlikely(__pyx_memoryview_slice_memviewslice(
28608 : &__pyx_t_7,
28609 : __pyx_v_y.shape[0], __pyx_v_y.strides[0], __pyx_v_y.suboffsets[0],
28610 : 0,
28611 : 0,
28612 : &__pyx_t_8,
28613 : 0,
28614 : __pyx_v_nc,
28615 : 0,
28616 : 0,
28617 : 1,
28618 : 0,
28619 : 1) < 0))
28620 : {
28621 0 : __PYX_ERR(0, 846, __pyx_L1_error)
28622 : }
28623 :
28624 426 : __pyx_t_7.shape[1] = __pyx_v_y.shape[1];
28625 426 : __pyx_t_7.strides[1] = __pyx_v_y.strides[1];
28626 426 : __pyx_t_7.suboffsets[1] = -1;
28627 :
28628 426 : __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_t_7, 2, (PyObject *(*)(char *)) __pyx_memview_get_double__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 846, __pyx_L1_error)
28629 426 : __Pyx_GOTREF(__pyx_t_6);
28630 426 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
28631 426 : __pyx_t_7.memview = NULL; __pyx_t_7.data = NULL;
28632 426 : __pyx_t_9 = NULL;
28633 426 : __pyx_t_10 = 0;
28634 : #if CYTHON_UNPACK_METHODS
28635 426 : if (unlikely(PyMethod_Check(__pyx_t_5))) {
28636 0 : __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
28637 0 : if (likely(__pyx_t_9)) {
28638 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
28639 0 : __Pyx_INCREF(__pyx_t_9);
28640 0 : __Pyx_INCREF(function);
28641 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
28642 : __pyx_t_10 = 1;
28643 : }
28644 : }
28645 : #endif
28646 426 : {
28647 426 : PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_6};
28648 426 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
28649 426 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
28650 426 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28651 426 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 846, __pyx_L1_error)
28652 426 : __Pyx_GOTREF(__pyx_t_2);
28653 426 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28654 : }
28655 426 : __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 846, __pyx_L1_error)
28656 426 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28657 426 : __pyx_v_c = __pyx_t_11;
28658 426 : __pyx_t_11.memview = NULL;
28659 426 : __pyx_t_11.data = NULL;
28660 :
28661 : /* "scipy/interpolate/_bspl.pyx":848
28662 : * cdef double[:, ::1] c = np.empty_like(y[:nc, :])
28663 : *
28664 : * fpback(&R[0, 0], m, nz, # <<<<<<<<<<<<<<
28665 : * nc,
28666 : * &y[0, 0], y.shape[1],
28667 : */
28668 426 : __pyx_t_12 = 0;
28669 426 : __pyx_t_13 = 0;
28670 426 : __pyx_t_8 = -1;
28671 426 : if (__pyx_t_12 < 0) {
28672 : __pyx_t_12 += __pyx_v_R.shape[0];
28673 : if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
28674 426 : } else if (unlikely(__pyx_t_12 >= __pyx_v_R.shape[0])) __pyx_t_8 = 0;
28675 426 : if (__pyx_t_13 < 0) {
28676 : __pyx_t_13 += __pyx_v_R.shape[1];
28677 : if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 1;
28678 426 : } else if (unlikely(__pyx_t_13 >= __pyx_v_R.shape[1])) __pyx_t_8 = 1;
28679 426 : if (unlikely(__pyx_t_8 != -1)) {
28680 0 : __Pyx_RaiseBufferIndexError(__pyx_t_8);
28681 0 : __PYX_ERR(0, 848, __pyx_L1_error)
28682 : }
28683 :
28684 : /* "scipy/interpolate/_bspl.pyx":850
28685 : * fpback(&R[0, 0], m, nz,
28686 : * nc,
28687 : * &y[0, 0], y.shape[1], # <<<<<<<<<<<<<<
28688 : * &c[0, 0])
28689 : *
28690 : */
28691 426 : __pyx_t_14 = 0;
28692 426 : __pyx_t_15 = 0;
28693 426 : __pyx_t_8 = -1;
28694 426 : if (__pyx_t_14 < 0) {
28695 : __pyx_t_14 += __pyx_v_y.shape[0];
28696 : if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 0;
28697 426 : } else if (unlikely(__pyx_t_14 >= __pyx_v_y.shape[0])) __pyx_t_8 = 0;
28698 426 : if (__pyx_t_15 < 0) {
28699 : __pyx_t_15 += __pyx_v_y.shape[1];
28700 : if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 1;
28701 426 : } else if (unlikely(__pyx_t_15 >= __pyx_v_y.shape[1])) __pyx_t_8 = 1;
28702 426 : if (unlikely(__pyx_t_8 != -1)) {
28703 0 : __Pyx_RaiseBufferIndexError(__pyx_t_8);
28704 0 : __PYX_ERR(0, 850, __pyx_L1_error)
28705 : }
28706 :
28707 : /* "scipy/interpolate/_bspl.pyx":851
28708 : * nc,
28709 : * &y[0, 0], y.shape[1],
28710 : * &c[0, 0]) # <<<<<<<<<<<<<<
28711 : *
28712 : * return np.asarray(c)
28713 : */
28714 426 : __pyx_t_16 = 0;
28715 426 : __pyx_t_17 = 0;
28716 426 : __pyx_t_8 = -1;
28717 426 : if (__pyx_t_16 < 0) {
28718 : __pyx_t_16 += __pyx_v_c.shape[0];
28719 : if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 0;
28720 426 : } else if (unlikely(__pyx_t_16 >= __pyx_v_c.shape[0])) __pyx_t_8 = 0;
28721 426 : if (__pyx_t_17 < 0) {
28722 : __pyx_t_17 += __pyx_v_c.shape[1];
28723 : if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 1;
28724 426 : } else if (unlikely(__pyx_t_17 >= __pyx_v_c.shape[1])) __pyx_t_8 = 1;
28725 426 : if (unlikely(__pyx_t_8 != -1)) {
28726 0 : __Pyx_RaiseBufferIndexError(__pyx_t_8);
28727 0 : __PYX_ERR(0, 851, __pyx_L1_error)
28728 : }
28729 :
28730 : /* "scipy/interpolate/_bspl.pyx":848
28731 : * cdef double[:, ::1] c = np.empty_like(y[:nc, :])
28732 : *
28733 : * fpback(&R[0, 0], m, nz, # <<<<<<<<<<<<<<
28734 : * nc,
28735 : * &y[0, 0], y.shape[1],
28736 : */
28737 426 : try {
28738 426 : fitpack::fpback((&(*((double const *) ( /* dim=1 */ ((char *) (((double const *) ( /* dim=0 */ (__pyx_v_R.data + __pyx_t_12 * __pyx_v_R.strides[0]) )) + __pyx_t_13)) )))), __pyx_v_m, __pyx_v_nz, __pyx_v_nc, (&(*((double const *) ( /* dim=1 */ ((char *) (((double const *) ( /* dim=0 */ (__pyx_v_y.data + __pyx_t_14 * __pyx_v_y.strides[0]) )) + __pyx_t_15)) )))), (__pyx_v_y.shape[1]), (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_c.data + __pyx_t_16 * __pyx_v_c.strides[0]) )) + __pyx_t_17)) )))));
28739 0 : } catch(...) {
28740 0 : __Pyx_CppExn2PyErr();
28741 0 : __PYX_ERR(0, 848, __pyx_L1_error)
28742 0 : }
28743 :
28744 : /* "scipy/interpolate/_bspl.pyx":853
28745 : * &c[0, 0])
28746 : *
28747 : * return np.asarray(c) # <<<<<<<<<<<<<<
28748 : *
28749 : *
28750 : */
28751 426 : __Pyx_XDECREF(__pyx_r);
28752 426 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 853, __pyx_L1_error)
28753 426 : __Pyx_GOTREF(__pyx_t_5);
28754 426 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error)
28755 426 : __Pyx_GOTREF(__pyx_t_6);
28756 426 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28757 426 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_c, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 853, __pyx_L1_error)
28758 426 : __Pyx_GOTREF(__pyx_t_5);
28759 426 : __pyx_t_9 = NULL;
28760 426 : __pyx_t_10 = 0;
28761 : #if CYTHON_UNPACK_METHODS
28762 426 : if (unlikely(PyMethod_Check(__pyx_t_6))) {
28763 0 : __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
28764 0 : if (likely(__pyx_t_9)) {
28765 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
28766 0 : __Pyx_INCREF(__pyx_t_9);
28767 0 : __Pyx_INCREF(function);
28768 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
28769 : __pyx_t_10 = 1;
28770 : }
28771 : }
28772 : #endif
28773 426 : {
28774 426 : PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_5};
28775 426 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
28776 426 : __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
28777 426 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28778 426 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 853, __pyx_L1_error)
28779 426 : __Pyx_GOTREF(__pyx_t_2);
28780 426 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28781 : }
28782 426 : __pyx_r = __pyx_t_2;
28783 426 : __pyx_t_2 = 0;
28784 426 : goto __pyx_L0;
28785 :
28786 : /* "scipy/interpolate/_bspl.pyx":834
28787 : *
28788 : *
28789 : * def _fpback(const double[:, ::1] R, ssize_t nc, # (R, offset, nc) triangular => offset is range(nc) # <<<<<<<<<<<<<<
28790 : * const double[:, ::1] y
28791 : * ):
28792 : */
28793 :
28794 : /* function exit code */
28795 3 : __pyx_L1_error:;
28796 3 : __Pyx_XDECREF(__pyx_t_2);
28797 3 : __Pyx_XDECREF(__pyx_t_5);
28798 3 : __Pyx_XDECREF(__pyx_t_6);
28799 3 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
28800 3 : __Pyx_XDECREF(__pyx_t_9);
28801 3 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_11, 1);
28802 3 : __Pyx_AddTraceback("scipy.interpolate._bspl._fpback", __pyx_clineno, __pyx_lineno, __pyx_filename);
28803 : __pyx_r = NULL;
28804 429 : __pyx_L0:;
28805 429 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_c, 1);
28806 429 : __Pyx_XGIVEREF(__pyx_r);
28807 429 : __Pyx_RefNannyFinishContext();
28808 429 : return __pyx_r;
28809 : }
28810 :
28811 : /* "scipy/interpolate/_bspl.pyx":856
28812 : *
28813 : *
28814 : * def _fpknot(const double[::1] x, # <<<<<<<<<<<<<<
28815 : * const double[::1] t,
28816 : * int k,
28817 : */
28818 :
28819 : /* Python wrapper */
28820 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_23_fpknot(PyObject *__pyx_self,
28821 : #if CYTHON_METH_FASTCALL
28822 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
28823 : #else
28824 : PyObject *__pyx_args, PyObject *__pyx_kwds
28825 : #endif
28826 : ); /*proto*/
28827 : static PyMethodDef __pyx_mdef_5scipy_11interpolate_5_bspl_23_fpknot = {"_fpknot", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_11interpolate_5_bspl_23_fpknot, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
28828 143 : static PyObject *__pyx_pw_5scipy_11interpolate_5_bspl_23_fpknot(PyObject *__pyx_self,
28829 : #if CYTHON_METH_FASTCALL
28830 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
28831 : #else
28832 : PyObject *__pyx_args, PyObject *__pyx_kwds
28833 : #endif
28834 : ) {
28835 143 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
28836 143 : __Pyx_memviewslice __pyx_v_t = { 0, 0, { 0 }, { 0 }, { 0 } };
28837 143 : int __pyx_v_k;
28838 143 : __Pyx_memviewslice __pyx_v_residuals = { 0, 0, { 0 }, { 0 }, { 0 } };
28839 : #if !CYTHON_METH_FASTCALL
28840 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
28841 : #endif
28842 143 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
28843 143 : PyObject* values[4] = {0,0,0,0};
28844 143 : int __pyx_lineno = 0;
28845 143 : const char *__pyx_filename = NULL;
28846 143 : int __pyx_clineno = 0;
28847 143 : PyObject *__pyx_r = 0;
28848 : __Pyx_RefNannyDeclarations
28849 143 : __Pyx_RefNannySetupContext("_fpknot (wrapper)", 0);
28850 : #if !CYTHON_METH_FASTCALL
28851 : #if CYTHON_ASSUME_SAFE_MACROS
28852 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
28853 : #else
28854 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
28855 : #endif
28856 : #endif
28857 143 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
28858 143 : {
28859 143 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_k,&__pyx_n_s_residuals,0};
28860 143 : if (__pyx_kwds) {
28861 0 : Py_ssize_t kw_args;
28862 0 : switch (__pyx_nargs) {
28863 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
28864 0 : CYTHON_FALLTHROUGH;
28865 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
28866 0 : CYTHON_FALLTHROUGH;
28867 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
28868 0 : CYTHON_FALLTHROUGH;
28869 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
28870 0 : CYTHON_FALLTHROUGH;
28871 0 : case 0: break;
28872 0 : default: goto __pyx_L5_argtuple_error;
28873 : }
28874 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
28875 0 : switch (__pyx_nargs) {
28876 0 : case 0:
28877 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
28878 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
28879 0 : kw_args--;
28880 : }
28881 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error)
28882 0 : else goto __pyx_L5_argtuple_error;
28883 0 : CYTHON_FALLTHROUGH;
28884 0 : case 1:
28885 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_t)) != 0)) {
28886 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
28887 0 : kw_args--;
28888 : }
28889 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error)
28890 : else {
28891 0 : __Pyx_RaiseArgtupleInvalid("_fpknot", 1, 4, 4, 1); __PYX_ERR(0, 856, __pyx_L3_error)
28892 : }
28893 0 : CYTHON_FALLTHROUGH;
28894 0 : case 2:
28895 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) {
28896 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
28897 0 : kw_args--;
28898 : }
28899 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error)
28900 : else {
28901 0 : __Pyx_RaiseArgtupleInvalid("_fpknot", 1, 4, 4, 2); __PYX_ERR(0, 856, __pyx_L3_error)
28902 : }
28903 0 : CYTHON_FALLTHROUGH;
28904 0 : case 3:
28905 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_residuals)) != 0)) {
28906 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
28907 0 : kw_args--;
28908 : }
28909 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error)
28910 : else {
28911 0 : __Pyx_RaiseArgtupleInvalid("_fpknot", 1, 4, 4, 3); __PYX_ERR(0, 856, __pyx_L3_error)
28912 : }
28913 : }
28914 0 : if (unlikely(kw_args > 0)) {
28915 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
28916 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_fpknot") < 0)) __PYX_ERR(0, 856, __pyx_L3_error)
28917 : }
28918 143 : } else if (unlikely(__pyx_nargs != 4)) {
28919 0 : goto __pyx_L5_argtuple_error;
28920 : } else {
28921 143 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
28922 143 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
28923 143 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
28924 143 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
28925 : }
28926 143 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 856, __pyx_L3_error)
28927 143 : __pyx_v_t = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[1], 0); if (unlikely(!__pyx_v_t.memview)) __PYX_ERR(0, 857, __pyx_L3_error)
28928 143 : __pyx_v_k = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 858, __pyx_L3_error)
28929 143 : __pyx_v_residuals = __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(values[3], 0); if (unlikely(!__pyx_v_residuals.memview)) __PYX_ERR(0, 859, __pyx_L3_error)
28930 : }
28931 143 : goto __pyx_L6_skip;
28932 0 : __pyx_L5_argtuple_error:;
28933 0 : __Pyx_RaiseArgtupleInvalid("_fpknot", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 856, __pyx_L3_error)
28934 143 : __pyx_L6_skip:;
28935 143 : goto __pyx_L4_argument_unpacking_done;
28936 0 : __pyx_L3_error:;
28937 0 : {
28938 0 : Py_ssize_t __pyx_temp;
28939 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
28940 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
28941 : }
28942 : }
28943 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
28944 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
28945 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_residuals, 1);
28946 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._fpknot", __pyx_clineno, __pyx_lineno, __pyx_filename);
28947 : __Pyx_RefNannyFinishContext();
28948 : return NULL;
28949 143 : __pyx_L4_argument_unpacking_done:;
28950 143 : __pyx_r = __pyx_pf_5scipy_11interpolate_5_bspl_22_fpknot(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_k, __pyx_v_residuals);
28951 :
28952 : /* function exit code */
28953 143 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
28954 143 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_t, 1);
28955 143 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_residuals, 1);
28956 : {
28957 : Py_ssize_t __pyx_temp;
28958 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
28959 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
28960 : }
28961 : }
28962 : __Pyx_RefNannyFinishContext();
28963 : return __pyx_r;
28964 : }
28965 :
28966 143 : static PyObject *__pyx_pf_5scipy_11interpolate_5_bspl_22_fpknot(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_t, int __pyx_v_k, __Pyx_memviewslice __pyx_v_residuals) {
28967 143 : PyObject *__pyx_r = NULL;
28968 : __Pyx_RefNannyDeclarations
28969 143 : int __pyx_t_1;
28970 143 : PyObject *__pyx_t_2 = NULL;
28971 143 : Py_ssize_t __pyx_t_3;
28972 143 : Py_UCS4 __pyx_t_4;
28973 143 : Py_ssize_t __pyx_t_5;
28974 143 : PyObject *__pyx_t_6 = NULL;
28975 143 : Py_ssize_t __pyx_t_7;
28976 143 : int __pyx_t_8;
28977 143 : Py_ssize_t __pyx_t_9;
28978 143 : Py_ssize_t __pyx_t_10;
28979 143 : double __pyx_t_11;
28980 143 : int __pyx_lineno = 0;
28981 143 : const char *__pyx_filename = NULL;
28982 143 : int __pyx_clineno = 0;
28983 143 : __Pyx_RefNannySetupContext("_fpknot", 1);
28984 :
28985 : /* "scipy/interpolate/_bspl.pyx":860
28986 : * int k,
28987 : * const double[::1] residuals):
28988 : * if x.shape[0] != residuals.shape[0]: # <<<<<<<<<<<<<<
28989 : * raise ValueError(f"{len(x) = } != {len(residuals) =}")
28990 : *
28991 : */
28992 143 : __pyx_t_1 = ((__pyx_v_x.shape[0]) != (__pyx_v_residuals.shape[0]));
28993 143 : if (unlikely(__pyx_t_1)) {
28994 :
28995 : /* "scipy/interpolate/_bspl.pyx":861
28996 : * const double[::1] residuals):
28997 : * if x.shape[0] != residuals.shape[0]:
28998 : * raise ValueError(f"{len(x) = } != {len(residuals) =}") # <<<<<<<<<<<<<<
28999 : *
29000 : * return fpknot(&x[0], x.shape[0],
29001 : */
29002 0 : __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
29003 0 : __Pyx_GOTREF(__pyx_t_2);
29004 0 : __pyx_t_3 = 0;
29005 0 : __pyx_t_4 = 127;
29006 0 : __Pyx_INCREF(__pyx_kp_u_len_x_2);
29007 0 : __pyx_t_3 += 9;
29008 0 : __Pyx_GIVEREF(__pyx_kp_u_len_x_2);
29009 0 : PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_len_x_2);
29010 0 : __pyx_t_5 = __Pyx_MemoryView_Len(__pyx_v_x);
29011 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
29012 0 : __Pyx_GOTREF(__pyx_t_6);
29013 0 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
29014 0 : __Pyx_GIVEREF(__pyx_t_6);
29015 0 : PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
29016 0 : __pyx_t_6 = 0;
29017 0 : __Pyx_INCREF(__pyx_kp_u_len_residuals);
29018 0 : __pyx_t_3 += 20;
29019 0 : __Pyx_GIVEREF(__pyx_kp_u_len_residuals);
29020 0 : PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_len_residuals);
29021 0 : __pyx_t_5 = __Pyx_MemoryView_Len(__pyx_v_residuals);
29022 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_5, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
29023 0 : __Pyx_GOTREF(__pyx_t_6);
29024 0 : __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
29025 0 : __Pyx_GIVEREF(__pyx_t_6);
29026 0 : PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
29027 0 : __pyx_t_6 = 0;
29028 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 861, __pyx_L1_error)
29029 0 : __Pyx_GOTREF(__pyx_t_6);
29030 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29031 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
29032 0 : __Pyx_GOTREF(__pyx_t_2);
29033 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
29034 0 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
29035 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29036 0 : __PYX_ERR(0, 861, __pyx_L1_error)
29037 :
29038 : /* "scipy/interpolate/_bspl.pyx":860
29039 : * int k,
29040 : * const double[::1] residuals):
29041 : * if x.shape[0] != residuals.shape[0]: # <<<<<<<<<<<<<<
29042 : * raise ValueError(f"{len(x) = } != {len(residuals) =}")
29043 : *
29044 : */
29045 : }
29046 :
29047 : /* "scipy/interpolate/_bspl.pyx":863
29048 : * raise ValueError(f"{len(x) = } != {len(residuals) =}")
29049 : *
29050 : * return fpknot(&x[0], x.shape[0], # <<<<<<<<<<<<<<
29051 : * &t[0], t.shape[0],
29052 : * k,
29053 : */
29054 143 : __Pyx_XDECREF(__pyx_r);
29055 143 : __pyx_t_7 = 0;
29056 143 : __pyx_t_8 = -1;
29057 143 : if (__pyx_t_7 < 0) {
29058 : __pyx_t_7 += __pyx_v_x.shape[0];
29059 : if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
29060 143 : } else if (unlikely(__pyx_t_7 >= __pyx_v_x.shape[0])) __pyx_t_8 = 0;
29061 143 : if (unlikely(__pyx_t_8 != -1)) {
29062 0 : __Pyx_RaiseBufferIndexError(__pyx_t_8);
29063 0 : __PYX_ERR(0, 863, __pyx_L1_error)
29064 : }
29065 :
29066 : /* "scipy/interpolate/_bspl.pyx":864
29067 : *
29068 : * return fpknot(&x[0], x.shape[0],
29069 : * &t[0], t.shape[0], # <<<<<<<<<<<<<<
29070 : * k,
29071 : * &residuals[0])
29072 : */
29073 143 : __pyx_t_9 = 0;
29074 143 : __pyx_t_8 = -1;
29075 143 : if (__pyx_t_9 < 0) {
29076 : __pyx_t_9 += __pyx_v_t.shape[0];
29077 : if (unlikely(__pyx_t_9 < 0)) __pyx_t_8 = 0;
29078 143 : } else if (unlikely(__pyx_t_9 >= __pyx_v_t.shape[0])) __pyx_t_8 = 0;
29079 143 : if (unlikely(__pyx_t_8 != -1)) {
29080 0 : __Pyx_RaiseBufferIndexError(__pyx_t_8);
29081 0 : __PYX_ERR(0, 864, __pyx_L1_error)
29082 : }
29083 :
29084 : /* "scipy/interpolate/_bspl.pyx":866
29085 : * &t[0], t.shape[0],
29086 : * k,
29087 : * &residuals[0]) # <<<<<<<<<<<<<<
29088 : */
29089 143 : __pyx_t_10 = 0;
29090 143 : __pyx_t_8 = -1;
29091 143 : if (__pyx_t_10 < 0) {
29092 : __pyx_t_10 += __pyx_v_residuals.shape[0];
29093 : if (unlikely(__pyx_t_10 < 0)) __pyx_t_8 = 0;
29094 143 : } else if (unlikely(__pyx_t_10 >= __pyx_v_residuals.shape[0])) __pyx_t_8 = 0;
29095 143 : if (unlikely(__pyx_t_8 != -1)) {
29096 0 : __Pyx_RaiseBufferIndexError(__pyx_t_8);
29097 0 : __PYX_ERR(0, 866, __pyx_L1_error)
29098 : }
29099 :
29100 : /* "scipy/interpolate/_bspl.pyx":863
29101 : * raise ValueError(f"{len(x) = } != {len(residuals) =}")
29102 : *
29103 : * return fpknot(&x[0], x.shape[0], # <<<<<<<<<<<<<<
29104 : * &t[0], t.shape[0],
29105 : * k,
29106 : */
29107 143 : try {
29108 143 : __pyx_t_11 = fitpack::fpknot((&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_x.data) + __pyx_t_7)) )))), (__pyx_v_x.shape[0]), (&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_t.data) + __pyx_t_9)) )))), (__pyx_v_t.shape[0]), __pyx_v_k, (&(*((double const *) ( /* dim=0 */ ((char *) (((double const *) __pyx_v_residuals.data) + __pyx_t_10)) )))));
29109 0 : } catch(...) {
29110 0 : __Pyx_CppExn2PyErr();
29111 0 : __PYX_ERR(0, 863, __pyx_L1_error)
29112 0 : }
29113 143 : __pyx_t_2 = PyFloat_FromDouble(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
29114 143 : __Pyx_GOTREF(__pyx_t_2);
29115 143 : __pyx_r = __pyx_t_2;
29116 143 : __pyx_t_2 = 0;
29117 143 : goto __pyx_L0;
29118 :
29119 : /* "scipy/interpolate/_bspl.pyx":856
29120 : *
29121 : *
29122 : * def _fpknot(const double[::1] x, # <<<<<<<<<<<<<<
29123 : * const double[::1] t,
29124 : * int k,
29125 : */
29126 :
29127 : /* function exit code */
29128 0 : __pyx_L1_error:;
29129 0 : __Pyx_XDECREF(__pyx_t_2);
29130 0 : __Pyx_XDECREF(__pyx_t_6);
29131 0 : __Pyx_AddTraceback("scipy.interpolate._bspl._fpknot", __pyx_clineno, __pyx_lineno, __pyx_filename);
29132 0 : __pyx_r = NULL;
29133 143 : __pyx_L0:;
29134 143 : __Pyx_XGIVEREF(__pyx_r);
29135 143 : __Pyx_RefNannyFinishContext();
29136 143 : return __pyx_r;
29137 : }
29138 : static struct __pyx_vtabstruct_array __pyx_vtable_array;
29139 :
29140 0 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
29141 0 : struct __pyx_array_obj *p;
29142 0 : PyObject *o;
29143 : #if CYTHON_COMPILING_IN_LIMITED_API
29144 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
29145 : o = alloc_func(t, 0);
29146 : #else
29147 0 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
29148 0 : o = (*t->tp_alloc)(t, 0);
29149 : } else {
29150 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
29151 : }
29152 0 : if (unlikely(!o)) return 0;
29153 : #endif
29154 0 : p = ((struct __pyx_array_obj *)o);
29155 0 : p->__pyx_vtab = __pyx_vtabptr_array;
29156 0 : p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
29157 0 : p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
29158 0 : if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
29159 : return o;
29160 0 : bad:
29161 0 : Py_DECREF(o); o = 0;
29162 : return NULL;
29163 : }
29164 :
29165 0 : static void __pyx_tp_dealloc_array(PyObject *o) {
29166 0 : struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
29167 : #if CYTHON_USE_TP_FINALIZE
29168 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
29169 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
29170 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
29171 : }
29172 : }
29173 : #endif
29174 0 : {
29175 0 : PyObject *etype, *eval, *etb;
29176 0 : PyErr_Fetch(&etype, &eval, &etb);
29177 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
29178 0 : __pyx_array___dealloc__(o);
29179 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
29180 0 : PyErr_Restore(etype, eval, etb);
29181 : }
29182 0 : Py_CLEAR(p->mode);
29183 0 : Py_CLEAR(p->_format);
29184 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
29185 0 : (*Py_TYPE(o)->tp_free)(o);
29186 : #else
29187 : {
29188 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
29189 : if (tp_free) tp_free(o);
29190 : }
29191 : #endif
29192 : }
29193 0 : static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
29194 0 : PyObject *r;
29195 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
29196 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
29197 0 : Py_DECREF(x);
29198 : return r;
29199 : }
29200 :
29201 0 : static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
29202 0 : if (v) {
29203 0 : return __pyx_array___setitem__(o, i, v);
29204 : }
29205 : else {
29206 0 : __Pyx_TypeName o_type_name;
29207 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
29208 0 : PyErr_Format(PyExc_NotImplementedError,
29209 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
29210 0 : __Pyx_DECREF_TypeName(o_type_name);
29211 0 : return -1;
29212 : }
29213 : }
29214 :
29215 0 : static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
29216 0 : PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
29217 0 : if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
29218 0 : PyErr_Clear();
29219 0 : v = __pyx_array___getattr__(o, n);
29220 : }
29221 0 : return v;
29222 : }
29223 :
29224 0 : static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
29225 0 : return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
29226 : }
29227 :
29228 : static PyMethodDef __pyx_methods_array[] = {
29229 : {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
29230 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29231 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29232 : {0, 0, 0, 0}
29233 : };
29234 :
29235 : static struct PyGetSetDef __pyx_getsets_array[] = {
29236 : {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
29237 : {0, 0, 0, 0, 0}
29238 : };
29239 : #if CYTHON_USE_TYPE_SPECS
29240 : #if !CYTHON_COMPILING_IN_LIMITED_API
29241 :
29242 : static PyBufferProcs __pyx_tp_as_buffer_array = {
29243 : #if PY_MAJOR_VERSION < 3
29244 : 0, /*bf_getreadbuffer*/
29245 : #endif
29246 : #if PY_MAJOR_VERSION < 3
29247 : 0, /*bf_getwritebuffer*/
29248 : #endif
29249 : #if PY_MAJOR_VERSION < 3
29250 : 0, /*bf_getsegcount*/
29251 : #endif
29252 : #if PY_MAJOR_VERSION < 3
29253 : 0, /*bf_getcharbuffer*/
29254 : #endif
29255 : __pyx_array_getbuffer, /*bf_getbuffer*/
29256 : 0, /*bf_releasebuffer*/
29257 : };
29258 : #endif
29259 : static PyType_Slot __pyx_type___pyx_array_slots[] = {
29260 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
29261 : {Py_sq_length, (void *)__pyx_array___len__},
29262 : {Py_sq_item, (void *)__pyx_sq_item_array},
29263 : {Py_mp_length, (void *)__pyx_array___len__},
29264 : {Py_mp_subscript, (void *)__pyx_array___getitem__},
29265 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
29266 : {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
29267 : #if defined(Py_bf_getbuffer)
29268 : {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
29269 : #endif
29270 : {Py_tp_methods, (void *)__pyx_methods_array},
29271 : {Py_tp_getset, (void *)__pyx_getsets_array},
29272 : {Py_tp_new, (void *)__pyx_tp_new_array},
29273 : {0, 0},
29274 : };
29275 : static PyType_Spec __pyx_type___pyx_array_spec = {
29276 : "scipy.interpolate._bspl.array",
29277 : sizeof(struct __pyx_array_obj),
29278 : 0,
29279 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
29280 : __pyx_type___pyx_array_slots,
29281 : };
29282 : #else
29283 :
29284 : static PySequenceMethods __pyx_tp_as_sequence_array = {
29285 : __pyx_array___len__, /*sq_length*/
29286 : 0, /*sq_concat*/
29287 : 0, /*sq_repeat*/
29288 : __pyx_sq_item_array, /*sq_item*/
29289 : 0, /*sq_slice*/
29290 : 0, /*sq_ass_item*/
29291 : 0, /*sq_ass_slice*/
29292 : 0, /*sq_contains*/
29293 : 0, /*sq_inplace_concat*/
29294 : 0, /*sq_inplace_repeat*/
29295 : };
29296 :
29297 : static PyMappingMethods __pyx_tp_as_mapping_array = {
29298 : __pyx_array___len__, /*mp_length*/
29299 : __pyx_array___getitem__, /*mp_subscript*/
29300 : __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
29301 : };
29302 :
29303 : static PyBufferProcs __pyx_tp_as_buffer_array = {
29304 : #if PY_MAJOR_VERSION < 3
29305 : 0, /*bf_getreadbuffer*/
29306 : #endif
29307 : #if PY_MAJOR_VERSION < 3
29308 : 0, /*bf_getwritebuffer*/
29309 : #endif
29310 : #if PY_MAJOR_VERSION < 3
29311 : 0, /*bf_getsegcount*/
29312 : #endif
29313 : #if PY_MAJOR_VERSION < 3
29314 : 0, /*bf_getcharbuffer*/
29315 : #endif
29316 : __pyx_array_getbuffer, /*bf_getbuffer*/
29317 : 0, /*bf_releasebuffer*/
29318 : };
29319 :
29320 : static PyTypeObject __pyx_type___pyx_array = {
29321 : PyVarObject_HEAD_INIT(0, 0)
29322 : "scipy.interpolate._bspl.""array", /*tp_name*/
29323 : sizeof(struct __pyx_array_obj), /*tp_basicsize*/
29324 : 0, /*tp_itemsize*/
29325 : __pyx_tp_dealloc_array, /*tp_dealloc*/
29326 : #if PY_VERSION_HEX < 0x030800b4
29327 : 0, /*tp_print*/
29328 : #endif
29329 : #if PY_VERSION_HEX >= 0x030800b4
29330 : 0, /*tp_vectorcall_offset*/
29331 : #endif
29332 : 0, /*tp_getattr*/
29333 : 0, /*tp_setattr*/
29334 : #if PY_MAJOR_VERSION < 3
29335 : 0, /*tp_compare*/
29336 : #endif
29337 : #if PY_MAJOR_VERSION >= 3
29338 : 0, /*tp_as_async*/
29339 : #endif
29340 : 0, /*tp_repr*/
29341 : 0, /*tp_as_number*/
29342 : &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
29343 : &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
29344 : 0, /*tp_hash*/
29345 : 0, /*tp_call*/
29346 : 0, /*tp_str*/
29347 : __pyx_tp_getattro_array, /*tp_getattro*/
29348 : 0, /*tp_setattro*/
29349 : &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
29350 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
29351 : 0, /*tp_doc*/
29352 : 0, /*tp_traverse*/
29353 : 0, /*tp_clear*/
29354 : 0, /*tp_richcompare*/
29355 : 0, /*tp_weaklistoffset*/
29356 : 0, /*tp_iter*/
29357 : 0, /*tp_iternext*/
29358 : __pyx_methods_array, /*tp_methods*/
29359 : 0, /*tp_members*/
29360 : __pyx_getsets_array, /*tp_getset*/
29361 : 0, /*tp_base*/
29362 : 0, /*tp_dict*/
29363 : 0, /*tp_descr_get*/
29364 : 0, /*tp_descr_set*/
29365 : #if !CYTHON_USE_TYPE_SPECS
29366 : 0, /*tp_dictoffset*/
29367 : #endif
29368 : 0, /*tp_init*/
29369 : 0, /*tp_alloc*/
29370 : __pyx_tp_new_array, /*tp_new*/
29371 : 0, /*tp_free*/
29372 : 0, /*tp_is_gc*/
29373 : 0, /*tp_bases*/
29374 : 0, /*tp_mro*/
29375 : 0, /*tp_cache*/
29376 : 0, /*tp_subclasses*/
29377 : 0, /*tp_weaklist*/
29378 : 0, /*tp_del*/
29379 : 0, /*tp_version_tag*/
29380 : #if PY_VERSION_HEX >= 0x030400a1
29381 : #if CYTHON_USE_TP_FINALIZE
29382 : 0, /*tp_finalize*/
29383 : #else
29384 : NULL, /*tp_finalize*/
29385 : #endif
29386 : #endif
29387 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
29388 : 0, /*tp_vectorcall*/
29389 : #endif
29390 : #if __PYX_NEED_TP_PRINT_SLOT == 1
29391 : 0, /*tp_print*/
29392 : #endif
29393 : #if PY_VERSION_HEX >= 0x030C0000
29394 : 0, /*tp_watched*/
29395 : #endif
29396 : #if PY_VERSION_HEX >= 0x030d00A4
29397 : 0, /*tp_versions_used*/
29398 : #endif
29399 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
29400 : 0, /*tp_pypy_flags*/
29401 : #endif
29402 : };
29403 : #endif
29404 :
29405 15 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
29406 15 : struct __pyx_MemviewEnum_obj *p;
29407 15 : PyObject *o;
29408 : #if CYTHON_COMPILING_IN_LIMITED_API
29409 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
29410 : o = alloc_func(t, 0);
29411 : #else
29412 15 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
29413 15 : o = (*t->tp_alloc)(t, 0);
29414 : } else {
29415 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
29416 : }
29417 15 : if (unlikely(!o)) return 0;
29418 : #endif
29419 15 : p = ((struct __pyx_MemviewEnum_obj *)o);
29420 15 : p->name = Py_None; Py_INCREF(Py_None);
29421 : return o;
29422 : }
29423 :
29424 0 : static void __pyx_tp_dealloc_Enum(PyObject *o) {
29425 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
29426 : #if CYTHON_USE_TP_FINALIZE
29427 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
29428 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
29429 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
29430 : }
29431 : }
29432 : #endif
29433 0 : PyObject_GC_UnTrack(o);
29434 0 : Py_CLEAR(p->name);
29435 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
29436 0 : (*Py_TYPE(o)->tp_free)(o);
29437 : #else
29438 : {
29439 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
29440 : if (tp_free) tp_free(o);
29441 : }
29442 : #endif
29443 : }
29444 :
29445 685 : static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
29446 685 : int e;
29447 685 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
29448 685 : if (p->name) {
29449 685 : e = (*v)(p->name, a); if (e) return e;
29450 : }
29451 : return 0;
29452 : }
29453 :
29454 0 : static int __pyx_tp_clear_Enum(PyObject *o) {
29455 0 : PyObject* tmp;
29456 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
29457 0 : tmp = ((PyObject*)p->name);
29458 0 : p->name = Py_None; Py_INCREF(Py_None);
29459 0 : Py_XDECREF(tmp);
29460 0 : return 0;
29461 : }
29462 :
29463 0 : static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
29464 0 : return __pyx_MemviewEnum___repr__(self);
29465 : }
29466 :
29467 : static PyMethodDef __pyx_methods_Enum[] = {
29468 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0},
29469 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29470 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29471 : {0, 0, 0, 0}
29472 : };
29473 : #if CYTHON_USE_TYPE_SPECS
29474 : static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
29475 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
29476 : {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
29477 : {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
29478 : {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
29479 : {Py_tp_methods, (void *)__pyx_methods_Enum},
29480 : {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
29481 : {Py_tp_new, (void *)__pyx_tp_new_Enum},
29482 : {0, 0},
29483 : };
29484 : static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
29485 : "scipy.interpolate._bspl.Enum",
29486 : sizeof(struct __pyx_MemviewEnum_obj),
29487 : 0,
29488 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
29489 : __pyx_type___pyx_MemviewEnum_slots,
29490 : };
29491 : #else
29492 :
29493 : static PyTypeObject __pyx_type___pyx_MemviewEnum = {
29494 : PyVarObject_HEAD_INIT(0, 0)
29495 : "scipy.interpolate._bspl.""Enum", /*tp_name*/
29496 : sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
29497 : 0, /*tp_itemsize*/
29498 : __pyx_tp_dealloc_Enum, /*tp_dealloc*/
29499 : #if PY_VERSION_HEX < 0x030800b4
29500 : 0, /*tp_print*/
29501 : #endif
29502 : #if PY_VERSION_HEX >= 0x030800b4
29503 : 0, /*tp_vectorcall_offset*/
29504 : #endif
29505 : 0, /*tp_getattr*/
29506 : 0, /*tp_setattr*/
29507 : #if PY_MAJOR_VERSION < 3
29508 : 0, /*tp_compare*/
29509 : #endif
29510 : #if PY_MAJOR_VERSION >= 3
29511 : 0, /*tp_as_async*/
29512 : #endif
29513 : __pyx_MemviewEnum___repr__, /*tp_repr*/
29514 : 0, /*tp_as_number*/
29515 : 0, /*tp_as_sequence*/
29516 : 0, /*tp_as_mapping*/
29517 : 0, /*tp_hash*/
29518 : 0, /*tp_call*/
29519 : 0, /*tp_str*/
29520 : 0, /*tp_getattro*/
29521 : 0, /*tp_setattro*/
29522 : 0, /*tp_as_buffer*/
29523 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
29524 : 0, /*tp_doc*/
29525 : __pyx_tp_traverse_Enum, /*tp_traverse*/
29526 : __pyx_tp_clear_Enum, /*tp_clear*/
29527 : 0, /*tp_richcompare*/
29528 : 0, /*tp_weaklistoffset*/
29529 : 0, /*tp_iter*/
29530 : 0, /*tp_iternext*/
29531 : __pyx_methods_Enum, /*tp_methods*/
29532 : 0, /*tp_members*/
29533 : 0, /*tp_getset*/
29534 : 0, /*tp_base*/
29535 : 0, /*tp_dict*/
29536 : 0, /*tp_descr_get*/
29537 : 0, /*tp_descr_set*/
29538 : #if !CYTHON_USE_TYPE_SPECS
29539 : 0, /*tp_dictoffset*/
29540 : #endif
29541 : __pyx_MemviewEnum___init__, /*tp_init*/
29542 : 0, /*tp_alloc*/
29543 : __pyx_tp_new_Enum, /*tp_new*/
29544 : 0, /*tp_free*/
29545 : 0, /*tp_is_gc*/
29546 : 0, /*tp_bases*/
29547 : 0, /*tp_mro*/
29548 : 0, /*tp_cache*/
29549 : 0, /*tp_subclasses*/
29550 : 0, /*tp_weaklist*/
29551 : 0, /*tp_del*/
29552 : 0, /*tp_version_tag*/
29553 : #if PY_VERSION_HEX >= 0x030400a1
29554 : #if CYTHON_USE_TP_FINALIZE
29555 : 0, /*tp_finalize*/
29556 : #else
29557 : NULL, /*tp_finalize*/
29558 : #endif
29559 : #endif
29560 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
29561 : 0, /*tp_vectorcall*/
29562 : #endif
29563 : #if __PYX_NEED_TP_PRINT_SLOT == 1
29564 : 0, /*tp_print*/
29565 : #endif
29566 : #if PY_VERSION_HEX >= 0x030C0000
29567 : 0, /*tp_watched*/
29568 : #endif
29569 : #if PY_VERSION_HEX >= 0x030d00A4
29570 : 0, /*tp_versions_used*/
29571 : #endif
29572 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
29573 : 0, /*tp_pypy_flags*/
29574 : #endif
29575 : };
29576 : #endif
29577 : static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
29578 :
29579 78202 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
29580 78202 : struct __pyx_memoryview_obj *p;
29581 78202 : PyObject *o;
29582 : #if CYTHON_COMPILING_IN_LIMITED_API
29583 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
29584 : o = alloc_func(t, 0);
29585 : #else
29586 78202 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
29587 78202 : o = (*t->tp_alloc)(t, 0);
29588 : } else {
29589 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
29590 : }
29591 78202 : if (unlikely(!o)) return 0;
29592 : #endif
29593 78202 : p = ((struct __pyx_memoryview_obj *)o);
29594 78202 : p->__pyx_vtab = __pyx_vtabptr_memoryview;
29595 78202 : p->obj = Py_None; Py_INCREF(Py_None);
29596 78202 : p->_size = Py_None; Py_INCREF(Py_None);
29597 78202 : p->_array_interface = Py_None; Py_INCREF(Py_None);
29598 78202 : p->view.obj = NULL;
29599 78202 : if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
29600 : return o;
29601 0 : bad:
29602 0 : Py_DECREF(o); o = 0;
29603 : return NULL;
29604 : }
29605 :
29606 78202 : static void __pyx_tp_dealloc_memoryview(PyObject *o) {
29607 78202 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
29608 : #if CYTHON_USE_TP_FINALIZE
29609 78202 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
29610 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
29611 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
29612 : }
29613 : }
29614 : #endif
29615 78202 : PyObject_GC_UnTrack(o);
29616 78202 : {
29617 78202 : PyObject *etype, *eval, *etb;
29618 78202 : PyErr_Fetch(&etype, &eval, &etb);
29619 78202 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
29620 78202 : __pyx_memoryview___dealloc__(o);
29621 78202 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
29622 78202 : PyErr_Restore(etype, eval, etb);
29623 : }
29624 78202 : Py_CLEAR(p->obj);
29625 78202 : Py_CLEAR(p->_size);
29626 78202 : Py_CLEAR(p->_array_interface);
29627 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
29628 78202 : (*Py_TYPE(o)->tp_free)(o);
29629 : #else
29630 : {
29631 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
29632 : if (tp_free) tp_free(o);
29633 : }
29634 : #endif
29635 : }
29636 :
29637 0 : static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
29638 0 : int e;
29639 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
29640 0 : if (p->obj) {
29641 0 : e = (*v)(p->obj, a); if (e) return e;
29642 : }
29643 0 : if (p->_size) {
29644 0 : e = (*v)(p->_size, a); if (e) return e;
29645 : }
29646 0 : if (p->_array_interface) {
29647 0 : e = (*v)(p->_array_interface, a); if (e) return e;
29648 : }
29649 0 : if (p->view.obj) {
29650 0 : e = (*v)(p->view.obj, a); if (e) return e;
29651 : }
29652 : return 0;
29653 : }
29654 :
29655 0 : static int __pyx_tp_clear_memoryview(PyObject *o) {
29656 0 : PyObject* tmp;
29657 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
29658 0 : tmp = ((PyObject*)p->obj);
29659 0 : p->obj = Py_None; Py_INCREF(Py_None);
29660 0 : Py_XDECREF(tmp);
29661 0 : tmp = ((PyObject*)p->_size);
29662 0 : p->_size = Py_None; Py_INCREF(Py_None);
29663 0 : Py_XDECREF(tmp);
29664 0 : tmp = ((PyObject*)p->_array_interface);
29665 0 : p->_array_interface = Py_None; Py_INCREF(Py_None);
29666 0 : Py_XDECREF(tmp);
29667 0 : Py_CLEAR(p->view.obj);
29668 0 : return 0;
29669 : }
29670 2834 : static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
29671 2834 : PyObject *r;
29672 2834 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
29673 2834 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
29674 2834 : Py_DECREF(x);
29675 : return r;
29676 : }
29677 :
29678 0 : static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
29679 0 : if (v) {
29680 0 : return __pyx_memoryview___setitem__(o, i, v);
29681 : }
29682 : else {
29683 0 : __Pyx_TypeName o_type_name;
29684 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
29685 0 : PyErr_Format(PyExc_NotImplementedError,
29686 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
29687 0 : __Pyx_DECREF_TypeName(o_type_name);
29688 0 : return -1;
29689 : }
29690 : }
29691 :
29692 0 : static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
29693 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
29694 : }
29695 :
29696 0 : static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
29697 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
29698 : }
29699 :
29700 0 : static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
29701 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
29702 : }
29703 :
29704 0 : static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
29705 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
29706 : }
29707 :
29708 0 : static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
29709 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
29710 : }
29711 :
29712 0 : static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
29713 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
29714 : }
29715 :
29716 0 : static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
29717 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
29718 : }
29719 :
29720 0 : static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
29721 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
29722 : }
29723 :
29724 0 : static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
29725 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
29726 : }
29727 :
29728 0 : static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
29729 0 : return __pyx_memoryview___repr__(self);
29730 : }
29731 :
29732 : static PyMethodDef __pyx_methods_memoryview[] = {
29733 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0},
29734 : {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29735 : {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29736 : {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29737 : {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29738 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29739 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29740 : {0, 0, 0, 0}
29741 : };
29742 :
29743 : static struct PyGetSetDef __pyx_getsets_memoryview[] = {
29744 : {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
29745 : {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
29746 : {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
29747 : {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
29748 : {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
29749 : {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
29750 : {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
29751 : {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
29752 : {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
29753 : {0, 0, 0, 0, 0}
29754 : };
29755 : #if CYTHON_USE_TYPE_SPECS
29756 : #if !CYTHON_COMPILING_IN_LIMITED_API
29757 :
29758 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
29759 : #if PY_MAJOR_VERSION < 3
29760 : 0, /*bf_getreadbuffer*/
29761 : #endif
29762 : #if PY_MAJOR_VERSION < 3
29763 : 0, /*bf_getwritebuffer*/
29764 : #endif
29765 : #if PY_MAJOR_VERSION < 3
29766 : 0, /*bf_getsegcount*/
29767 : #endif
29768 : #if PY_MAJOR_VERSION < 3
29769 : 0, /*bf_getcharbuffer*/
29770 : #endif
29771 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
29772 : 0, /*bf_releasebuffer*/
29773 : };
29774 : #endif
29775 : static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
29776 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
29777 : {Py_tp_repr, (void *)__pyx_memoryview___repr__},
29778 : {Py_sq_length, (void *)__pyx_memoryview___len__},
29779 : {Py_sq_item, (void *)__pyx_sq_item_memoryview},
29780 : {Py_mp_length, (void *)__pyx_memoryview___len__},
29781 : {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
29782 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
29783 : {Py_tp_str, (void *)__pyx_memoryview___str__},
29784 : #if defined(Py_bf_getbuffer)
29785 : {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
29786 : #endif
29787 : {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
29788 : {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
29789 : {Py_tp_methods, (void *)__pyx_methods_memoryview},
29790 : {Py_tp_getset, (void *)__pyx_getsets_memoryview},
29791 : {Py_tp_new, (void *)__pyx_tp_new_memoryview},
29792 : {0, 0},
29793 : };
29794 : static PyType_Spec __pyx_type___pyx_memoryview_spec = {
29795 : "scipy.interpolate._bspl.memoryview",
29796 : sizeof(struct __pyx_memoryview_obj),
29797 : 0,
29798 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
29799 : __pyx_type___pyx_memoryview_slots,
29800 : };
29801 : #else
29802 :
29803 : static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
29804 : __pyx_memoryview___len__, /*sq_length*/
29805 : 0, /*sq_concat*/
29806 : 0, /*sq_repeat*/
29807 : __pyx_sq_item_memoryview, /*sq_item*/
29808 : 0, /*sq_slice*/
29809 : 0, /*sq_ass_item*/
29810 : 0, /*sq_ass_slice*/
29811 : 0, /*sq_contains*/
29812 : 0, /*sq_inplace_concat*/
29813 : 0, /*sq_inplace_repeat*/
29814 : };
29815 :
29816 : static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
29817 : __pyx_memoryview___len__, /*mp_length*/
29818 : __pyx_memoryview___getitem__, /*mp_subscript*/
29819 : __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
29820 : };
29821 :
29822 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
29823 : #if PY_MAJOR_VERSION < 3
29824 : 0, /*bf_getreadbuffer*/
29825 : #endif
29826 : #if PY_MAJOR_VERSION < 3
29827 : 0, /*bf_getwritebuffer*/
29828 : #endif
29829 : #if PY_MAJOR_VERSION < 3
29830 : 0, /*bf_getsegcount*/
29831 : #endif
29832 : #if PY_MAJOR_VERSION < 3
29833 : 0, /*bf_getcharbuffer*/
29834 : #endif
29835 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
29836 : 0, /*bf_releasebuffer*/
29837 : };
29838 :
29839 : static PyTypeObject __pyx_type___pyx_memoryview = {
29840 : PyVarObject_HEAD_INIT(0, 0)
29841 : "scipy.interpolate._bspl.""memoryview", /*tp_name*/
29842 : sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
29843 : 0, /*tp_itemsize*/
29844 : __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
29845 : #if PY_VERSION_HEX < 0x030800b4
29846 : 0, /*tp_print*/
29847 : #endif
29848 : #if PY_VERSION_HEX >= 0x030800b4
29849 : 0, /*tp_vectorcall_offset*/
29850 : #endif
29851 : 0, /*tp_getattr*/
29852 : 0, /*tp_setattr*/
29853 : #if PY_MAJOR_VERSION < 3
29854 : 0, /*tp_compare*/
29855 : #endif
29856 : #if PY_MAJOR_VERSION >= 3
29857 : 0, /*tp_as_async*/
29858 : #endif
29859 : __pyx_memoryview___repr__, /*tp_repr*/
29860 : 0, /*tp_as_number*/
29861 : &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
29862 : &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
29863 : 0, /*tp_hash*/
29864 : 0, /*tp_call*/
29865 : __pyx_memoryview___str__, /*tp_str*/
29866 : 0, /*tp_getattro*/
29867 : 0, /*tp_setattro*/
29868 : &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
29869 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
29870 : 0, /*tp_doc*/
29871 : __pyx_tp_traverse_memoryview, /*tp_traverse*/
29872 : __pyx_tp_clear_memoryview, /*tp_clear*/
29873 : 0, /*tp_richcompare*/
29874 : 0, /*tp_weaklistoffset*/
29875 : 0, /*tp_iter*/
29876 : 0, /*tp_iternext*/
29877 : __pyx_methods_memoryview, /*tp_methods*/
29878 : 0, /*tp_members*/
29879 : __pyx_getsets_memoryview, /*tp_getset*/
29880 : 0, /*tp_base*/
29881 : 0, /*tp_dict*/
29882 : 0, /*tp_descr_get*/
29883 : 0, /*tp_descr_set*/
29884 : #if !CYTHON_USE_TYPE_SPECS
29885 : 0, /*tp_dictoffset*/
29886 : #endif
29887 : 0, /*tp_init*/
29888 : 0, /*tp_alloc*/
29889 : __pyx_tp_new_memoryview, /*tp_new*/
29890 : 0, /*tp_free*/
29891 : 0, /*tp_is_gc*/
29892 : 0, /*tp_bases*/
29893 : 0, /*tp_mro*/
29894 : 0, /*tp_cache*/
29895 : 0, /*tp_subclasses*/
29896 : 0, /*tp_weaklist*/
29897 : 0, /*tp_del*/
29898 : 0, /*tp_version_tag*/
29899 : #if PY_VERSION_HEX >= 0x030400a1
29900 : #if CYTHON_USE_TP_FINALIZE
29901 : 0, /*tp_finalize*/
29902 : #else
29903 : NULL, /*tp_finalize*/
29904 : #endif
29905 : #endif
29906 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
29907 : 0, /*tp_vectorcall*/
29908 : #endif
29909 : #if __PYX_NEED_TP_PRINT_SLOT == 1
29910 : 0, /*tp_print*/
29911 : #endif
29912 : #if PY_VERSION_HEX >= 0x030C0000
29913 : 0, /*tp_watched*/
29914 : #endif
29915 : #if PY_VERSION_HEX >= 0x030d00A4
29916 : 0, /*tp_versions_used*/
29917 : #endif
29918 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
29919 : 0, /*tp_pypy_flags*/
29920 : #endif
29921 : };
29922 : #endif
29923 : static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
29924 :
29925 2484 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
29926 2484 : struct __pyx_memoryviewslice_obj *p;
29927 2484 : PyObject *o = __pyx_tp_new_memoryview(t, a, k);
29928 2484 : if (unlikely(!o)) return 0;
29929 2484 : p = ((struct __pyx_memoryviewslice_obj *)o);
29930 2484 : p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
29931 2484 : new((void*)&(p->from_slice)) __Pyx_memviewslice();
29932 2484 : p->from_object = Py_None; Py_INCREF(Py_None);
29933 2484 : p->from_slice.memview = NULL;
29934 2484 : return o;
29935 : }
29936 :
29937 2484 : static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
29938 2484 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
29939 : #if CYTHON_USE_TP_FINALIZE
29940 2484 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
29941 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
29942 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
29943 : }
29944 : }
29945 : #endif
29946 2484 : PyObject_GC_UnTrack(o);
29947 2484 : {
29948 2484 : PyObject *etype, *eval, *etb;
29949 2484 : PyErr_Fetch(&etype, &eval, &etb);
29950 2484 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
29951 2484 : __pyx_memoryviewslice___dealloc__(o);
29952 2484 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
29953 2484 : PyErr_Restore(etype, eval, etb);
29954 : }
29955 2484 : __Pyx_call_destructor(p->from_slice);
29956 2484 : Py_CLEAR(p->from_object);
29957 2484 : PyObject_GC_Track(o);
29958 2484 : __pyx_tp_dealloc_memoryview(o);
29959 : }
29960 :
29961 0 : static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
29962 0 : int e;
29963 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
29964 0 : e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
29965 0 : if (p->from_object) {
29966 0 : e = (*v)(p->from_object, a); if (e) return e;
29967 : }
29968 : return 0;
29969 : }
29970 :
29971 0 : static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
29972 0 : PyObject* tmp;
29973 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
29974 0 : __pyx_tp_clear_memoryview(o);
29975 0 : tmp = ((PyObject*)p->from_object);
29976 0 : p->from_object = Py_None; Py_INCREF(Py_None);
29977 0 : Py_XDECREF(tmp);
29978 0 : __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
29979 0 : return 0;
29980 : }
29981 :
29982 : static PyMethodDef __pyx_methods__memoryviewslice[] = {
29983 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29984 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
29985 : {0, 0, 0, 0}
29986 : };
29987 : #if CYTHON_USE_TYPE_SPECS
29988 : static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
29989 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
29990 : {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
29991 : {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
29992 : {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
29993 : {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
29994 : {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
29995 : {0, 0},
29996 : };
29997 : static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
29998 : "scipy.interpolate._bspl._memoryviewslice",
29999 : sizeof(struct __pyx_memoryviewslice_obj),
30000 : 0,
30001 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
30002 : __pyx_type___pyx_memoryviewslice_slots,
30003 : };
30004 : #else
30005 :
30006 : static PyTypeObject __pyx_type___pyx_memoryviewslice = {
30007 : PyVarObject_HEAD_INIT(0, 0)
30008 : "scipy.interpolate._bspl.""_memoryviewslice", /*tp_name*/
30009 : sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
30010 : 0, /*tp_itemsize*/
30011 : __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
30012 : #if PY_VERSION_HEX < 0x030800b4
30013 : 0, /*tp_print*/
30014 : #endif
30015 : #if PY_VERSION_HEX >= 0x030800b4
30016 : 0, /*tp_vectorcall_offset*/
30017 : #endif
30018 : 0, /*tp_getattr*/
30019 : 0, /*tp_setattr*/
30020 : #if PY_MAJOR_VERSION < 3
30021 : 0, /*tp_compare*/
30022 : #endif
30023 : #if PY_MAJOR_VERSION >= 3
30024 : 0, /*tp_as_async*/
30025 : #endif
30026 : #if CYTHON_COMPILING_IN_PYPY || 0
30027 : __pyx_memoryview___repr__, /*tp_repr*/
30028 : #else
30029 : 0, /*tp_repr*/
30030 : #endif
30031 : 0, /*tp_as_number*/
30032 : 0, /*tp_as_sequence*/
30033 : 0, /*tp_as_mapping*/
30034 : 0, /*tp_hash*/
30035 : 0, /*tp_call*/
30036 : #if CYTHON_COMPILING_IN_PYPY || 0
30037 : __pyx_memoryview___str__, /*tp_str*/
30038 : #else
30039 : 0, /*tp_str*/
30040 : #endif
30041 : 0, /*tp_getattro*/
30042 : 0, /*tp_setattro*/
30043 : 0, /*tp_as_buffer*/
30044 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
30045 : PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
30046 : __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
30047 : __pyx_tp_clear__memoryviewslice, /*tp_clear*/
30048 : 0, /*tp_richcompare*/
30049 : 0, /*tp_weaklistoffset*/
30050 : 0, /*tp_iter*/
30051 : 0, /*tp_iternext*/
30052 : __pyx_methods__memoryviewslice, /*tp_methods*/
30053 : 0, /*tp_members*/
30054 : 0, /*tp_getset*/
30055 : 0, /*tp_base*/
30056 : 0, /*tp_dict*/
30057 : 0, /*tp_descr_get*/
30058 : 0, /*tp_descr_set*/
30059 : #if !CYTHON_USE_TYPE_SPECS
30060 : 0, /*tp_dictoffset*/
30061 : #endif
30062 : 0, /*tp_init*/
30063 : 0, /*tp_alloc*/
30064 : __pyx_tp_new__memoryviewslice, /*tp_new*/
30065 : 0, /*tp_free*/
30066 : 0, /*tp_is_gc*/
30067 : 0, /*tp_bases*/
30068 : 0, /*tp_mro*/
30069 : 0, /*tp_cache*/
30070 : 0, /*tp_subclasses*/
30071 : 0, /*tp_weaklist*/
30072 : 0, /*tp_del*/
30073 : 0, /*tp_version_tag*/
30074 : #if PY_VERSION_HEX >= 0x030400a1
30075 : #if CYTHON_USE_TP_FINALIZE
30076 : 0, /*tp_finalize*/
30077 : #else
30078 : NULL, /*tp_finalize*/
30079 : #endif
30080 : #endif
30081 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
30082 : 0, /*tp_vectorcall*/
30083 : #endif
30084 : #if __PYX_NEED_TP_PRINT_SLOT == 1
30085 : 0, /*tp_print*/
30086 : #endif
30087 : #if PY_VERSION_HEX >= 0x030C0000
30088 : 0, /*tp_watched*/
30089 : #endif
30090 : #if PY_VERSION_HEX >= 0x030d00A4
30091 : 0, /*tp_versions_used*/
30092 : #endif
30093 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
30094 : 0, /*tp_pypy_flags*/
30095 : #endif
30096 : };
30097 : #endif
30098 :
30099 : static PyMethodDef __pyx_methods[] = {
30100 : {0, 0, 0, 0}
30101 : };
30102 : #ifndef CYTHON_SMALL_CODE
30103 : #if defined(__clang__)
30104 : #define CYTHON_SMALL_CODE
30105 : #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
30106 : #define CYTHON_SMALL_CODE __attribute__((cold))
30107 : #else
30108 : #define CYTHON_SMALL_CODE
30109 : #endif
30110 : #endif
30111 : /* #### Code section: pystring_table ### */
30112 :
30113 3 : static int __Pyx_CreateStringTabAndInitStrings(void) {
30114 3 : __Pyx_StringTabEntry __pyx_string_tab[] = {
30115 3 : {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
30116 3 : {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
30117 3 : {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
30118 3 : {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0},
30119 3 : {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
30120 3 : {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
30121 3 : {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
30122 3 : {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
30123 3 : {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
30124 3 : {&__pyx_kp_u_Cannot_do_derivative_order_s, __pyx_k_Cannot_do_derivative_order_s, sizeof(__pyx_k_Cannot_do_derivative_order_s), 0, 1, 0, 0},
30125 3 : {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0},
30126 3 : {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0},
30127 3 : {&__pyx_kp_u_D_points, __pyx_k_D_points, sizeof(__pyx_k_D_points), 0, 1, 0, 0},
30128 3 : {&__pyx_kp_u_D_space_got, __pyx_k_D_space_got, sizeof(__pyx_k_D_space_got), 0, 1, 0, 0},
30129 3 : {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0},
30130 3 : {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
30131 3 : {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
30132 3 : {&__pyx_kp_u_Evaluate_the_k_1_B_splines_which, __pyx_k_Evaluate_the_k_1_B_splines_which, sizeof(__pyx_k_Evaluate_the_k_1_B_splines_which), 0, 1, 0, 0},
30133 3 : {&__pyx_kp_u_Expacted_data_points_in, __pyx_k_Expacted_data_points_in, sizeof(__pyx_k_Expacted_data_points_in), 0, 1, 0, 0},
30134 3 : {&__pyx_kp_s_Expected_at_least_d_argument_s_g, __pyx_k_Expected_at_least_d_argument_s_g, sizeof(__pyx_k_Expected_at_least_d_argument_s_g), 0, 0, 1, 0},
30135 3 : {&__pyx_kp_s_Function_call_with_ambiguous_arg, __pyx_k_Function_call_with_ambiguous_arg, sizeof(__pyx_k_Function_call_with_ambiguous_arg), 0, 0, 1, 0},
30136 3 : {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
30137 3 : {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
30138 3 : {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
30139 3 : {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0},
30140 3 : {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
30141 3 : {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0},
30142 3 : {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0},
30143 3 : {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
30144 3 : {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
30145 3 : {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
30146 3 : {&__pyx_kp_s_No_matching_signature_found, __pyx_k_No_matching_signature_found, sizeof(__pyx_k_No_matching_signature_found), 0, 0, 1, 0},
30147 3 : {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
30148 3 : {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
30149 3 : {&__pyx_kp_u_Out_of_bounds_in_d, __pyx_k_Out_of_bounds_in_d, sizeof(__pyx_k_Out_of_bounds_in_d), 0, 1, 0, 0},
30150 3 : {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0},
30151 3 : {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
30152 3 : {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
30153 3 : {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
30154 3 : {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0},
30155 3 : {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
30156 3 : {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
30157 3 : {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
30158 3 : {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
30159 3 : {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0},
30160 3 : {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
30161 3 : {&__pyx_kp_u__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 1, 0, 0},
30162 3 : {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
30163 3 : {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1},
30164 3 : {&__pyx_n_s__52, __pyx_k__52, sizeof(__pyx_k__52), 0, 0, 1, 1},
30165 3 : {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
30166 3 : {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
30167 3 : {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
30168 3 : {&__pyx_n_s_ab, __pyx_k_ab, sizeof(__pyx_k_ab), 0, 0, 1, 1},
30169 3 : {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
30170 3 : {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
30171 3 : {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0},
30172 3 : {&__pyx_kp_u_and_out_shape_1, __pyx_k_and_out_shape_1, sizeof(__pyx_k_and_out_shape_1), 0, 1, 0, 0},
30173 3 : {&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
30174 3 : {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
30175 3 : {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
30176 3 : {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
30177 3 : {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
30178 3 : {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
30179 3 : {&__pyx_n_s_bbb, __pyx_k_bbb, sizeof(__pyx_k_bbb), 0, 0, 1, 1},
30180 3 : {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
30181 3 : {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
30182 3 : {&__pyx_n_s_c1r, __pyx_k_c1r, sizeof(__pyx_k_c1r), 0, 0, 1, 1},
30183 3 : {&__pyx_n_s_ci, __pyx_k_ci, sizeof(__pyx_k_ci), 0, 0, 1, 1},
30184 3 : {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
30185 3 : {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
30186 3 : {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
30187 3 : {&__pyx_n_s_clmn, __pyx_k_clmn, sizeof(__pyx_k_clmn), 0, 0, 1, 1},
30188 3 : {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
30189 3 : {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0},
30190 3 : {&__pyx_n_s_colloc, __pyx_k_colloc, sizeof(__pyx_k_colloc), 0, 0, 1, 1},
30191 3 : {&__pyx_n_s_colloc_nd, __pyx_k_colloc_nd, sizeof(__pyx_k_colloc_nd), 0, 0, 1, 1},
30192 3 : {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
30193 3 : {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
30194 3 : {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
30195 3 : {&__pyx_n_s_csr_data, __pyx_k_csr_data, sizeof(__pyx_k_csr_data), 0, 0, 1, 1},
30196 3 : {&__pyx_n_s_csr_indices, __pyx_k_csr_indices, sizeof(__pyx_k_csr_indices), 0, 0, 1, 1},
30197 3 : {&__pyx_n_s_csr_indptr, __pyx_k_csr_indptr, sizeof(__pyx_k_csr_indptr), 0, 0, 1, 1},
30198 3 : {&__pyx_n_s_cstrides, __pyx_k_cstrides, sizeof(__pyx_k_cstrides), 0, 0, 1, 1},
30199 3 : {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
30200 3 : {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
30201 3 : {&__pyx_n_s_data_matrix, __pyx_k_data_matrix, sizeof(__pyx_k_data_matrix), 0, 0, 1, 1},
30202 3 : {&__pyx_n_s_defaults, __pyx_k_defaults, sizeof(__pyx_k_defaults), 0, 0, 1, 1},
30203 3 : {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
30204 3 : {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
30205 3 : {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
30206 3 : {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
30207 3 : {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
30208 3 : {&__pyx_n_s_empty_like, __pyx_k_empty_like, sizeof(__pyx_k_empty_like), 0, 0, 1, 1},
30209 3 : {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
30210 3 : {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
30211 3 : {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
30212 3 : {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
30213 3 : {&__pyx_n_s_evaluate_all_bspl, __pyx_k_evaluate_all_bspl, sizeof(__pyx_k_evaluate_all_bspl), 0, 0, 1, 1},
30214 3 : {&__pyx_kp_u_evaluate_all_bspl_line_181, __pyx_k_evaluate_all_bspl_line_181, sizeof(__pyx_k_evaluate_all_bspl_line_181), 0, 1, 0, 0},
30215 3 : {&__pyx_n_s_evaluate_ndbspline, __pyx_k_evaluate_ndbspline, sizeof(__pyx_k_evaluate_ndbspline), 0, 0, 1, 1},
30216 3 : {&__pyx_n_s_evaluate_spline, __pyx_k_evaluate_spline, sizeof(__pyx_k_evaluate_spline), 0, 0, 1, 1},
30217 3 : {&__pyx_n_s_extrapolate, __pyx_k_extrapolate, sizeof(__pyx_k_extrapolate), 0, 0, 1, 1},
30218 3 : {&__pyx_n_s_factor, __pyx_k_factor, sizeof(__pyx_k_factor), 0, 0, 1, 1},
30219 3 : {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
30220 3 : {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
30221 3 : {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
30222 3 : {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
30223 3 : {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
30224 3 : {&__pyx_n_s_fpback, __pyx_k_fpback, sizeof(__pyx_k_fpback), 0, 0, 1, 1},
30225 3 : {&__pyx_n_s_fpknot, __pyx_k_fpknot, sizeof(__pyx_k_fpknot), 0, 0, 1, 1},
30226 3 : {&__pyx_n_s_fused_sigindex, __pyx_k_fused_sigindex, sizeof(__pyx_k_fused_sigindex), 0, 0, 1, 1},
30227 3 : {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
30228 3 : {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
30229 3 : {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
30230 3 : {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
30231 3 : {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0},
30232 3 : {&__pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_k_home_czgdp18079_Quansight_scipy, sizeof(__pyx_k_home_czgdp18079_Quansight_scipy), 0, 0, 1, 0},
30233 3 : {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
30234 3 : {&__pyx_n_s_i_c, __pyx_k_i_c, sizeof(__pyx_k_i_c), 0, 0, 1, 1},
30235 3 : {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
30236 3 : {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
30237 3 : {&__pyx_n_s_idx_b, __pyx_k_idx_b, sizeof(__pyx_k_idx_b), 0, 0, 1, 1},
30238 3 : {&__pyx_n_s_idx_c, __pyx_k_idx_c, sizeof(__pyx_k_idx_c), 0, 0, 1, 1},
30239 3 : {&__pyx_n_s_idx_cflat, __pyx_k_idx_cflat, sizeof(__pyx_k_idx_cflat), 0, 0, 1, 1},
30240 3 : {&__pyx_n_s_idx_cflat_base, __pyx_k_idx_cflat_base, sizeof(__pyx_k_idx_cflat_base), 0, 0, 1, 1},
30241 3 : {&__pyx_n_s_iflat, __pyx_k_iflat, sizeof(__pyx_k_iflat), 0, 0, 1, 1},
30242 3 : {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
30243 3 : {&__pyx_n_s_ind, __pyx_k_ind, sizeof(__pyx_k_ind), 0, 0, 1, 1},
30244 3 : {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
30245 3 : {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
30246 3 : {&__pyx_n_s_indices_k1d, __pyx_k_indices_k1d, sizeof(__pyx_k_indices_k1d), 0, 0, 1, 1},
30247 3 : {&__pyx_n_s_indices_k1d_2, __pyx_k_indices_k1d_2, sizeof(__pyx_k_indices_k1d_2), 0, 0, 1, 1},
30248 3 : {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
30249 3 : {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
30250 3 : {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1},
30251 3 : {&__pyx_n_s_intp, __pyx_k_intp, sizeof(__pyx_k_intp), 0, 0, 1, 1},
30252 3 : {&__pyx_n_s_ip, __pyx_k_ip, sizeof(__pyx_k_ip), 0, 0, 1, 1},
30253 3 : {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
30254 3 : {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
30255 3 : {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
30256 3 : {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
30257 3 : {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
30258 3 : {&__pyx_n_s_jp, __pyx_k_jp, sizeof(__pyx_k_jp), 0, 0, 1, 1},
30259 3 : {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
30260 3 : {&__pyx_n_s_kd, __pyx_k_kd, sizeof(__pyx_k_kd), 0, 0, 1, 1},
30261 3 : {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
30262 3 : {&__pyx_n_s_kl, __pyx_k_kl, sizeof(__pyx_k_kl), 0, 0, 1, 1},
30263 3 : {&__pyx_n_s_ku, __pyx_k_ku, sizeof(__pyx_k_ku), 0, 0, 1, 1},
30264 3 : {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
30265 3 : {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1},
30266 3 : {&__pyx_kp_u_len_residuals, __pyx_k_len_residuals, sizeof(__pyx_k_len_residuals), 0, 1, 0, 0},
30267 3 : {&__pyx_n_s_len_t, __pyx_k_len_t, sizeof(__pyx_k_len_t), 0, 0, 1, 1},
30268 3 : {&__pyx_kp_u_len_w, __pyx_k_len_w, sizeof(__pyx_k_len_w), 0, 1, 0, 0},
30269 3 : {&__pyx_kp_u_len_x, __pyx_k_len_x, sizeof(__pyx_k_len_x), 0, 1, 0, 0},
30270 3 : {&__pyx_kp_u_len_x_2, __pyx_k_len_x_2, sizeof(__pyx_k_len_x_2), 0, 1, 0, 0},
30271 3 : {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
30272 3 : {&__pyx_kp_u_m_2, __pyx_k_m_2, sizeof(__pyx_k_m_2), 0, 1, 0, 0},
30273 3 : {&__pyx_kp_u_m_3, __pyx_k_m_3, sizeof(__pyx_k_m_3), 0, 1, 0, 0},
30274 3 : {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
30275 3 : {&__pyx_n_s_make_design_matrix, __pyx_k_make_design_matrix, sizeof(__pyx_k_make_design_matrix), 0, 0, 1, 1},
30276 3 : {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
30277 3 : {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
30278 3 : {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
30279 3 : {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
30280 3 : {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
30281 3 : {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
30282 3 : {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
30283 3 : {&__pyx_kp_u_nc_2, __pyx_k_nc_2, sizeof(__pyx_k_nc_2), 0, 1, 0, 0},
30284 3 : {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
30285 3 : {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
30286 3 : {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
30287 3 : {&__pyx_n_s_norm_eq_lsq, __pyx_k_norm_eq_lsq, sizeof(__pyx_k_norm_eq_lsq), 0, 0, 1, 1},
30288 3 : {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
30289 3 : {&__pyx_n_s_npy_int32, __pyx_k_npy_int32, sizeof(__pyx_k_npy_int32), 0, 0, 1, 1},
30290 3 : {&__pyx_n_s_npy_int64, __pyx_k_npy_int64, sizeof(__pyx_k_npy_int64), 0, 0, 1, 1},
30291 3 : {&__pyx_n_s_nu, __pyx_k_nu, sizeof(__pyx_k_nu), 0, 0, 1, 1},
30292 3 : {&__pyx_n_s_num_c_tr, __pyx_k_num_c_tr, sizeof(__pyx_k_num_c_tr), 0, 0, 1, 1},
30293 3 : {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
30294 3 : {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
30295 3 : {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
30296 3 : {&__pyx_n_s_nz, __pyx_k_nz, sizeof(__pyx_k_nz), 0, 0, 1, 1},
30297 3 : {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
30298 3 : {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
30299 3 : {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
30300 3 : {&__pyx_n_s_out, __pyx_k_out, sizeof(__pyx_k_out), 0, 0, 1, 1},
30301 3 : {&__pyx_kp_u_out_and_c_are_inconsistent_num_c, __pyx_k_out_and_c_are_inconsistent_num_c, sizeof(__pyx_k_out_and_c_are_inconsistent_num_c), 0, 1, 0, 0},
30302 3 : {&__pyx_kp_u_out_and_c_have_incompatible_shap, __pyx_k_out_and_c_have_incompatible_shap, sizeof(__pyx_k_out_and_c_have_incompatible_shap), 0, 1, 0, 0},
30303 3 : {&__pyx_kp_u_out_and_xi_are_inconsistent_expe, __pyx_k_out_and_xi_are_inconsistent_expe, sizeof(__pyx_k_out_and_xi_are_inconsistent_expe), 0, 1, 0, 0},
30304 3 : {&__pyx_kp_u_out_and_xp_have_incompatible_sha, __pyx_k_out_and_xp_have_incompatible_sha, sizeof(__pyx_k_out_and_xp_have_incompatible_sha), 0, 1, 0, 0},
30305 3 : {&__pyx_n_s_out_of_bounds, __pyx_k_out_of_bounds, sizeof(__pyx_k_out_of_bounds), 0, 0, 1, 1},
30306 3 : {&__pyx_kp_u_output_values_got, __pyx_k_output_values_got, sizeof(__pyx_k_output_values_got), 0, 1, 0, 0},
30307 3 : {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
30308 3 : {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
30309 3 : {&__pyx_n_s_prev_l, __pyx_k_prev_l, sizeof(__pyx_k_prev_l), 0, 0, 1, 1},
30310 3 : {&__pyx_n_s_py_find_interval, __pyx_k_py_find_interval, sizeof(__pyx_k_py_find_interval), 0, 0, 1, 1},
30311 3 : {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
30312 3 : {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
30313 3 : {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
30314 3 : {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
30315 3 : {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
30316 3 : {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
30317 3 : {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
30318 3 : {&__pyx_n_s_qr_reduce, __pyx_k_qr_reduce, sizeof(__pyx_k_qr_reduce), 0, 0, 1, 1},
30319 3 : {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
30320 3 : {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
30321 3 : {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
30322 3 : {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
30323 3 : {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
30324 3 : {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
30325 3 : {&__pyx_n_s_residuals, __pyx_k_residuals, sizeof(__pyx_k_residuals), 0, 0, 1, 1},
30326 3 : {&__pyx_n_s_rhs, __pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 0, 1, 1},
30327 3 : {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
30328 3 : {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
30329 3 : {&__pyx_n_s_scipy_interpolate__bspl, __pyx_k_scipy_interpolate__bspl, sizeof(__pyx_k_scipy_interpolate__bspl), 0, 0, 1, 1},
30330 3 : {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
30331 3 : {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
30332 3 : {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
30333 3 : {&__pyx_n_s_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1},
30334 3 : {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
30335 3 : {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
30336 3 : {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
30337 3 : {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
30338 3 : {&__pyx_n_s_startrow, __pyx_k_startrow, sizeof(__pyx_k_startrow), 0, 0, 1, 1},
30339 3 : {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
30340 3 : {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
30341 3 : {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
30342 3 : {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
30343 3 : {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
30344 3 : {&__pyx_n_s_strides_c1, __pyx_k_strides_c1, sizeof(__pyx_k_strides_c1), 0, 0, 1, 1},
30345 3 : {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
30346 3 : {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
30347 3 : {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
30348 3 : {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
30349 3 : {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
30350 3 : {&__pyx_n_s_t_2, __pyx_k_t_2, sizeof(__pyx_k_t_2), 0, 0, 1, 1},
30351 3 : {&__pyx_n_s_td, __pyx_k_td, sizeof(__pyx_k_td), 0, 0, 1, 1},
30352 3 : {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
30353 3 : {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
30354 3 : {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
30355 3 : {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
30356 3 : {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
30357 3 : {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
30358 3 : {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
30359 3 : {&__pyx_n_s_volume, __pyx_k_volume, sizeof(__pyx_k_volume), 0, 0, 1, 1},
30360 3 : {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
30361 3 : {&__pyx_kp_u_with_xv, __pyx_k_with_xv, sizeof(__pyx_k_with_xv), 0, 1, 0, 0},
30362 3 : {&__pyx_n_s_work, __pyx_k_work, sizeof(__pyx_k_work), 0, 0, 1, 1},
30363 3 : {&__pyx_n_s_wrk, __pyx_k_wrk, sizeof(__pyx_k_wrk), 0, 0, 1, 1},
30364 3 : {&__pyx_n_s_wval, __pyx_k_wval, sizeof(__pyx_k_wval), 0, 0, 1, 1},
30365 3 : {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
30366 3 : {&__pyx_n_s_xd, __pyx_k_xd, sizeof(__pyx_k_xd), 0, 0, 1, 1},
30367 3 : {&__pyx_n_s_xi, __pyx_k_xi, sizeof(__pyx_k_xi), 0, 0, 1, 1},
30368 3 : {&__pyx_n_s_xp, __pyx_k_xp, sizeof(__pyx_k_xp), 0, 0, 1, 1},
30369 3 : {&__pyx_n_s_xv, __pyx_k_xv, sizeof(__pyx_k_xv), 0, 0, 1, 1},
30370 3 : {&__pyx_n_s_xval, __pyx_k_xval, sizeof(__pyx_k_xval), 0, 0, 1, 1},
30371 3 : {&__pyx_n_s_xvals, __pyx_k_xvals, sizeof(__pyx_k_xvals), 0, 0, 1, 1},
30372 3 : {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
30373 3 : {&__pyx_kp_u_y_shape, __pyx_k_y_shape, sizeof(__pyx_k_y_shape), 0, 1, 0, 0},
30374 3 : {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
30375 : {0, 0, 0, 0, 0, 0, 0}
30376 3 : };
30377 3 : return __Pyx_InitStrings(__pyx_string_tab);
30378 : }
30379 : /* #### Code section: cached_builtins ### */
30380 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
30381 3 : __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 145, __pyx_L1_error)
30382 3 : __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 151, __pyx_L1_error)
30383 3 : __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 158, __pyx_L1_error)
30384 3 : __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 383, __pyx_L1_error)
30385 3 : __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 541, __pyx_L1_error)
30386 3 : __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 100, __pyx_L1_error)
30387 3 : __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 156, __pyx_L1_error)
30388 3 : __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 159, __pyx_L1_error)
30389 3 : __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(1, 373, __pyx_L1_error)
30390 3 : __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error)
30391 3 : __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error)
30392 3 : __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error)
30393 3 : __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error)
30394 : return 0;
30395 : __pyx_L1_error:;
30396 : return -1;
30397 : }
30398 : /* #### Code section: cached_constants ### */
30399 :
30400 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
30401 : __Pyx_RefNannyDeclarations
30402 3 : __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
30403 :
30404 : /* "View.MemoryView":582
30405 : * def suboffsets(self):
30406 : * if self.view.suboffsets == NULL:
30407 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
30408 : *
30409 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
30410 : */
30411 3 : __pyx_tuple__4 = PyTuple_New(1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 582, __pyx_L1_error)
30412 3 : __Pyx_GOTREF(__pyx_tuple__4);
30413 3 : __Pyx_INCREF(__pyx_int_neg_1);
30414 3 : __Pyx_GIVEREF(__pyx_int_neg_1);
30415 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__4, 0, __pyx_int_neg_1)) __PYX_ERR(1, 582, __pyx_L1_error);
30416 3 : __Pyx_GIVEREF(__pyx_tuple__4);
30417 :
30418 : /* "View.MemoryView":679
30419 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
30420 : *
30421 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
30422 : * have_slices = False
30423 : * seen_ellipsis = False
30424 : */
30425 3 : __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error)
30426 3 : __Pyx_GOTREF(__pyx_slice__5);
30427 3 : __Pyx_GIVEREF(__pyx_slice__5);
30428 :
30429 : /* "(tree fragment)":4
30430 : * cdef object __pyx_PickleError
30431 : * cdef object __pyx_result
30432 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
30433 : * from pickle import PickleError as __pyx_PickleError
30434 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
30435 : */
30436 3 : __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
30437 3 : __Pyx_GOTREF(__pyx_tuple__8);
30438 3 : __Pyx_GIVEREF(__pyx_tuple__8);
30439 :
30440 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
30441 : * __pyx_import_array()
30442 : * except Exception:
30443 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
30444 : *
30445 : * cdef inline int import_umath() except -1:
30446 : */
30447 3 : __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error)
30448 3 : __Pyx_GOTREF(__pyx_tuple__9);
30449 3 : __Pyx_GIVEREF(__pyx_tuple__9);
30450 :
30451 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
30452 : * _import_umath()
30453 : * except Exception:
30454 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
30455 : *
30456 : * cdef inline int import_ufunc() except -1:
30457 : */
30458 3 : __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error)
30459 3 : __Pyx_GOTREF(__pyx_tuple__10);
30460 3 : __Pyx_GIVEREF(__pyx_tuple__10);
30461 :
30462 : /* "scipy/interpolate/_bspl.pyx":145
30463 : * # shape checks
30464 : * if out.shape[0] != xp.shape[0]:
30465 : * raise ValueError("out and xp have incompatible shapes") # <<<<<<<<<<<<<<
30466 : * if out.shape[1] != c.shape[1]:
30467 : * raise ValueError("out and c have incompatible shapes")
30468 : */
30469 3 : __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_out_and_xp_have_incompatible_sha); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 145, __pyx_L1_error)
30470 3 : __Pyx_GOTREF(__pyx_tuple__11);
30471 3 : __Pyx_GIVEREF(__pyx_tuple__11);
30472 :
30473 : /* "scipy/interpolate/_bspl.pyx":147
30474 : * raise ValueError("out and xp have incompatible shapes")
30475 : * if out.shape[1] != c.shape[1]:
30476 : * raise ValueError("out and c have incompatible shapes") # <<<<<<<<<<<<<<
30477 : *
30478 : * # check derivative order
30479 : */
30480 3 : __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_out_and_c_have_incompatible_shap); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 147, __pyx_L1_error)
30481 3 : __Pyx_GOTREF(__pyx_tuple__12);
30482 3 : __Pyx_GIVEREF(__pyx_tuple__12);
30483 :
30484 : /* "scipy/interpolate/_bspl.pyx":383
30485 : * rhs[row, ci] = rhs[row, ci] + wrk[r] * y[j, ci] * wval
30486 : *
30487 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
30488 : * @cython.boundscheck(False)
30489 : * def _make_design_matrix(const double[::1] x,
30490 : */
30491 3 : __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 383, __pyx_L1_error)
30492 3 : __Pyx_GOTREF(__pyx_tuple__15);
30493 3 : __Pyx_GIVEREF(__pyx_tuple__15);
30494 3 : __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 383, __pyx_L1_error)
30495 3 : __Pyx_GOTREF(__pyx_tuple__16);
30496 3 : __Pyx_GIVEREF(__pyx_tuple__16);
30497 :
30498 : /* "View.MemoryView":100
30499 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
30500 : * try:
30501 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
30502 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
30503 : * else:
30504 : */
30505 3 : __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 100, __pyx_L1_error)
30506 3 : __Pyx_GOTREF(__pyx_tuple__17);
30507 3 : __Pyx_GIVEREF(__pyx_tuple__17);
30508 3 : __pyx_tuple__18 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 100, __pyx_L1_error)
30509 3 : __Pyx_GOTREF(__pyx_tuple__18);
30510 3 : __Pyx_GIVEREF(__pyx_tuple__18);
30511 :
30512 : /* "View.MemoryView":101
30513 : * try:
30514 : * if __import__("sys").version_info >= (3, 3):
30515 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
30516 : * else:
30517 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
30518 : */
30519 3 : __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 101, __pyx_L1_error)
30520 3 : __Pyx_GOTREF(__pyx_tuple__19);
30521 3 : __Pyx_GIVEREF(__pyx_tuple__19);
30522 :
30523 : /* "View.MemoryView":103
30524 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
30525 : * else:
30526 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
30527 : * except:
30528 : *
30529 : */
30530 3 : __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 103, __pyx_L1_error)
30531 3 : __Pyx_GOTREF(__pyx_tuple__20);
30532 3 : __Pyx_GIVEREF(__pyx_tuple__20);
30533 :
30534 : /* "View.MemoryView":309
30535 : * return self.name
30536 : *
30537 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
30538 : * cdef strided = Enum("<strided and direct>") # default
30539 : * cdef indirect = Enum("<strided and indirect>")
30540 : */
30541 3 : __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 309, __pyx_L1_error)
30542 3 : __Pyx_GOTREF(__pyx_tuple__21);
30543 3 : __Pyx_GIVEREF(__pyx_tuple__21);
30544 :
30545 : /* "View.MemoryView":310
30546 : *
30547 : * cdef generic = Enum("<strided and direct or indirect>")
30548 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
30549 : * cdef indirect = Enum("<strided and indirect>")
30550 : *
30551 : */
30552 3 : __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 310, __pyx_L1_error)
30553 3 : __Pyx_GOTREF(__pyx_tuple__22);
30554 3 : __Pyx_GIVEREF(__pyx_tuple__22);
30555 :
30556 : /* "View.MemoryView":311
30557 : * cdef generic = Enum("<strided and direct or indirect>")
30558 : * cdef strided = Enum("<strided and direct>") # default
30559 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
30560 : *
30561 : *
30562 : */
30563 3 : __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 311, __pyx_L1_error)
30564 3 : __Pyx_GOTREF(__pyx_tuple__23);
30565 3 : __Pyx_GIVEREF(__pyx_tuple__23);
30566 :
30567 : /* "View.MemoryView":314
30568 : *
30569 : *
30570 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
30571 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
30572 : *
30573 : */
30574 3 : __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 314, __pyx_L1_error)
30575 3 : __Pyx_GOTREF(__pyx_tuple__24);
30576 3 : __Pyx_GIVEREF(__pyx_tuple__24);
30577 :
30578 : /* "View.MemoryView":315
30579 : *
30580 : * cdef contiguous = Enum("<contiguous and direct>")
30581 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
30582 : *
30583 : *
30584 : */
30585 3 : __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 315, __pyx_L1_error)
30586 3 : __Pyx_GOTREF(__pyx_tuple__25);
30587 3 : __Pyx_GIVEREF(__pyx_tuple__25);
30588 :
30589 : /* "(tree fragment)":1
30590 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
30591 : * cdef object __pyx_PickleError
30592 : * cdef object __pyx_result
30593 : */
30594 3 : __pyx_tuple__26 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 1, __pyx_L1_error)
30595 3 : __Pyx_GOTREF(__pyx_tuple__26);
30596 3 : __Pyx_GIVEREF(__pyx_tuple__26);
30597 3 : __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(1, 1, __pyx_L1_error)
30598 :
30599 : /* "scipy/interpolate/_bspl.pyx":98
30600 : * # NB: a python wrapper for find_interval. The leading underscore signals
30601 : * # it's not meant to be user-visible outside of _bsplines.py
30602 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
30603 : * @cython.boundscheck(False)
30604 : * def _py_find_interval(const double[::1] t,
30605 : */
30606 3 : __pyx_tuple__28 = PyTuple_Pack(5, __pyx_n_s_t, __pyx_n_s_k, __pyx_n_s_xval, __pyx_n_s_prev_l, __pyx_n_s_extrapolate); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 98, __pyx_L1_error)
30607 3 : __Pyx_GOTREF(__pyx_tuple__28);
30608 3 : __Pyx_GIVEREF(__pyx_tuple__28);
30609 3 : __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_py_find_interval, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 98, __pyx_L1_error)
30610 :
30611 : /* "scipy/interpolate/_bspl.pyx":108
30612 : *
30613 : *
30614 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
30615 : * @cython.boundscheck(False)
30616 : * @cython.cdivision(True)
30617 : */
30618 3 : __pyx_tuple__30 = PyTuple_Pack(13, __pyx_n_s_t, __pyx_n_s_c, __pyx_n_s_k, __pyx_n_s_xp, __pyx_n_s_nu, __pyx_n_s_extrapolate, __pyx_n_s_out, __pyx_n_s_ip, __pyx_n_s_jp, __pyx_n_s_a, __pyx_n_s_interval, __pyx_n_s_xval, __pyx_n_s_work); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 108, __pyx_L1_error)
30619 3 : __Pyx_GOTREF(__pyx_tuple__30);
30620 3 : __Pyx_GIVEREF(__pyx_tuple__30);
30621 3 : __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_evaluate_spline, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 108, __pyx_L1_error)
30622 :
30623 : /* "scipy/interpolate/_bspl.pyx":181
30624 : *
30625 : *
30626 : * def evaluate_all_bspl(const double[::1] t, int k, double xval, int m, int nu=0): # <<<<<<<<<<<<<<
30627 : * """Evaluate the ``k+1`` B-splines which are non-zero on interval ``m``.
30628 : *
30629 : */
30630 3 : __pyx_tuple__32 = PyTuple_Pack(7, __pyx_n_s_t, __pyx_n_s_k, __pyx_n_s_xval, __pyx_n_s_m, __pyx_n_s_nu, __pyx_n_s_bbb, __pyx_n_s_work); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 181, __pyx_L1_error)
30631 3 : __Pyx_GOTREF(__pyx_tuple__32);
30632 3 : __Pyx_GIVEREF(__pyx_tuple__32);
30633 3 : __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_evaluate_all_bspl, 181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 181, __pyx_L1_error)
30634 :
30635 : /* "scipy/interpolate/_bspl.pyx":242
30636 : *
30637 : *
30638 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
30639 : * @cython.boundscheck(False)
30640 : * def _colloc(const double[::1] x, const double[::1] t, int k, double[::1, :] ab,
30641 : */
30642 3 : __pyx_tuple__34 = PyTuple_Pack(13, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_k, __pyx_n_s_ab, __pyx_n_s_offset, __pyx_n_s_left, __pyx_n_s_j, __pyx_n_s_a, __pyx_n_s_kl, __pyx_n_s_ku, __pyx_n_s_clmn, __pyx_n_s_xval, __pyx_n_s_wrk); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 242, __pyx_L1_error)
30643 3 : __Pyx_GOTREF(__pyx_tuple__34);
30644 3 : __Pyx_GIVEREF(__pyx_tuple__34);
30645 3 : __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_colloc, 242, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 242, __pyx_L1_error)
30646 :
30647 : /* "scipy/interpolate/_bspl.pyx":303
30648 : *
30649 : *
30650 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
30651 : * @cython.boundscheck(False)
30652 : * def _norm_eq_lsq(const double[::1] x,
30653 : */
30654 3 : __pyx_tuple__36 = PyTuple_Pack(17, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_k, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_ab, __pyx_n_s_rhs, __pyx_n_s_j, __pyx_n_s_r, __pyx_n_s_s, __pyx_n_s_row, __pyx_n_s_clmn, __pyx_n_s_left, __pyx_n_s_ci, __pyx_n_s_xval, __pyx_n_s_wval, __pyx_n_s_wrk); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 303, __pyx_L1_error)
30655 3 : __Pyx_GOTREF(__pyx_tuple__36);
30656 3 : __Pyx_GIVEREF(__pyx_tuple__36);
30657 3 : __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_norm_eq_lsq, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 303, __pyx_L1_error)
30658 :
30659 : /* "scipy/interpolate/_bspl.pyx":383
30660 : * rhs[row, ci] = rhs[row, ci] + wrk[r] * y[j, ci] * wval
30661 : *
30662 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
30663 : * @cython.boundscheck(False)
30664 : * def _make_design_matrix(const double[::1] x,
30665 : */
30666 3 : __pyx_tuple__38 = PyTuple_Pack(13, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_k, __pyx_n_s_extrapolate, __pyx_n_s_indices, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_m, __pyx_n_s_ind, __pyx_n_s_n, __pyx_n_s_work, __pyx_n_s_data, __pyx_n_s_xval); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 383, __pyx_L1_error)
30667 3 : __Pyx_GOTREF(__pyx_tuple__38);
30668 3 : __Pyx_GIVEREF(__pyx_tuple__38);
30669 3 : __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_make_design_matrix, 383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 383, __pyx_L1_error)
30670 :
30671 : /* "scipy/interpolate/_bspl.pyx":446
30672 : *
30673 : *
30674 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
30675 : * @cython.boundscheck(False)
30676 : * @cython.nonecheck(False)
30677 : */
30678 3 : __pyx_tuple__40 = PyTuple_Pack(29, __pyx_n_s_xi, __pyx_n_s_t, __pyx_n_s_len_t, __pyx_n_s_k, __pyx_n_s_nu, __pyx_n_s_extrapolate, __pyx_n_s_c1r, __pyx_n_s_num_c_tr, __pyx_n_s_strides_c1, __pyx_n_s_indices_k1d, __pyx_n_s_out, __pyx_n_s_ndim, __pyx_n_s_i, __pyx_n_s_b, __pyx_n_s_xv, __pyx_n_s_xd, __pyx_n_s_td, __pyx_n_s_kd, __pyx_n_s_i_c, __pyx_n_s_iflat, __pyx_n_s_volume, __pyx_n_s_idx_b, __pyx_n_s_out_of_bounds, __pyx_n_s_idx_cflat_base, __pyx_n_s_idx, __pyx_n_s_factor, __pyx_n_s_wrk, __pyx_n_s_d, __pyx_n_s_j); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 446, __pyx_L1_error)
30679 3 : __Pyx_GOTREF(__pyx_tuple__40);
30680 3 : __Pyx_GIVEREF(__pyx_tuple__40);
30681 3 : __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(11, 0, 0, 29, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_evaluate_ndbspline, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 446, __pyx_L1_error)
30682 :
30683 : /* "scipy/interpolate/_bspl.pyx":641
30684 : *
30685 : *
30686 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
30687 : * @cython.nonecheck(False)
30688 : * @cython.boundscheck(False)
30689 : */
30690 3 : __pyx_tuple__42 = PyTuple_Pack(28, __pyx_n_s_xvals, __pyx_n_s_t_2, __pyx_n_s_len_t, __pyx_n_s_k, __pyx_n_s_indices_k1d_2, __pyx_n_s_cstrides, __pyx_n_s_size, __pyx_n_s_ndim, __pyx_n_s_i, __pyx_n_s_b, __pyx_n_s_xd, __pyx_n_s_td, __pyx_n_s_kd, __pyx_n_s_iflat, __pyx_n_s_volume, __pyx_n_s_idx_c, __pyx_n_s_idx_cflat, __pyx_n_s_nu, __pyx_n_s_out_of_bounds, __pyx_n_s_factor, __pyx_n_s_wrk, __pyx_n_s_csr_data, __pyx_n_s_csr_indices, __pyx_n_s_j, __pyx_n_s_d, __pyx_n_s_csr_indptr, __pyx_n_s_xv, __pyx_n_s_idx_b); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 641, __pyx_L1_error)
30691 3 : __Pyx_GOTREF(__pyx_tuple__42);
30692 3 : __Pyx_GIVEREF(__pyx_tuple__42);
30693 3 : __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 28, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_colloc_nd, 641, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 641, __pyx_L1_error)
30694 :
30695 : /* "scipy/interpolate/_bspl.pyx":796
30696 : * # wrappers for fitpack repro
30697 : * # ---------------------------
30698 : * def _qr_reduce(double[:, ::1] a, ssize_t[::1] offset, ssize_t nc, # A packed # <<<<<<<<<<<<<<
30699 : * double[:, ::1] y,
30700 : * ssize_t startrow=1
30701 : */
30702 3 : __pyx_tuple__44 = PyTuple_Pack(5, __pyx_n_s_a, __pyx_n_s_offset, __pyx_n_s_nc, __pyx_n_s_y, __pyx_n_s_startrow); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 796, __pyx_L1_error)
30703 3 : __Pyx_GOTREF(__pyx_tuple__44);
30704 3 : __Pyx_GIVEREF(__pyx_tuple__44);
30705 3 : __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_qr_reduce, 796, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 796, __pyx_L1_error)
30706 :
30707 : /* "scipy/interpolate/_bspl.pyx":808
30708 : *
30709 : *
30710 : * def _data_matrix(const double[::1] x, # <<<<<<<<<<<<<<
30711 : * const double[::1] t,
30712 : * int k,
30713 : */
30714 3 : __pyx_tuple__46 = PyTuple_Pack(9, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_k, __pyx_n_s_w, __pyx_n_s_m, __pyx_n_s_A, __pyx_n_s_offset, __pyx_n_s_wrk, __pyx_n_s_nc); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 808, __pyx_L1_error)
30715 3 : __Pyx_GOTREF(__pyx_tuple__46);
30716 3 : __Pyx_GIVEREF(__pyx_tuple__46);
30717 3 : __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_data_matrix, 808, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 808, __pyx_L1_error)
30718 :
30719 : /* "scipy/interpolate/_bspl.pyx":834
30720 : *
30721 : *
30722 : * def _fpback(const double[:, ::1] R, ssize_t nc, # (R, offset, nc) triangular => offset is range(nc) # <<<<<<<<<<<<<<
30723 : * const double[:, ::1] y
30724 : * ):
30725 : */
30726 3 : __pyx_tuple__48 = PyTuple_Pack(6, __pyx_n_s_R, __pyx_n_s_nc, __pyx_n_s_y, __pyx_n_s_m, __pyx_n_s_nz, __pyx_n_s_c); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 834, __pyx_L1_error)
30727 3 : __Pyx_GOTREF(__pyx_tuple__48);
30728 3 : __Pyx_GIVEREF(__pyx_tuple__48);
30729 3 : __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_fpback, 834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 834, __pyx_L1_error)
30730 :
30731 : /* "scipy/interpolate/_bspl.pyx":856
30732 : *
30733 : *
30734 : * def _fpknot(const double[::1] x, # <<<<<<<<<<<<<<
30735 : * const double[::1] t,
30736 : * int k,
30737 : */
30738 3 : __pyx_tuple__50 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_k, __pyx_n_s_residuals); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 856, __pyx_L1_error)
30739 3 : __Pyx_GOTREF(__pyx_tuple__50);
30740 3 : __Pyx_GIVEREF(__pyx_tuple__50);
30741 3 : __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_fpknot, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 856, __pyx_L1_error)
30742 : __Pyx_RefNannyFinishContext();
30743 : return 0;
30744 : __pyx_L1_error:;
30745 : __Pyx_RefNannyFinishContext();
30746 : return -1;
30747 : }
30748 : /* #### Code section: init_constants ### */
30749 :
30750 3 : static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
30751 3 : __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
30752 3 : __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
30753 3 : __pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
30754 3 : __pyx_umethod_PyDict_Type_values.method_name = &__pyx_n_s_values;
30755 3 : if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
30756 3 : __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
30757 3 : __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
30758 3 : __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
30759 3 : __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
30760 3 : __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
30761 3 : __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
30762 3 : __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
30763 3 : __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
30764 3 : __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
30765 3 : __pyx_int_neg_101 = PyInt_FromLong(-101); if (unlikely(!__pyx_int_neg_101)) __PYX_ERR(0, 1, __pyx_L1_error)
30766 : return 0;
30767 : __pyx_L1_error:;
30768 : return -1;
30769 : }
30770 : /* #### Code section: init_globals ### */
30771 :
30772 3 : static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
30773 : /* AssertionsEnabled.init */
30774 3 : if (likely(__Pyx_init_assertions_enabled() == 0)); else
30775 :
30776 0 : if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
30777 :
30778 : return 0;
30779 0 : __pyx_L1_error:;
30780 0 : return -1;
30781 : }
30782 : /* #### Code section: init_module ### */
30783 :
30784 : static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
30785 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
30786 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
30787 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
30788 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
30789 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
30790 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
30791 :
30792 3 : static int __Pyx_modinit_global_init_code(void) {
30793 : __Pyx_RefNannyDeclarations
30794 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
30795 : /*--- Global init code ---*/
30796 3 : __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
30797 3 : generic = Py_None; Py_INCREF(Py_None);
30798 3 : strided = Py_None; Py_INCREF(Py_None);
30799 3 : indirect = Py_None; Py_INCREF(Py_None);
30800 3 : contiguous = Py_None; Py_INCREF(Py_None);
30801 3 : indirect_contiguous = Py_None; Py_INCREF(Py_None);
30802 3 : __Pyx_RefNannyFinishContext();
30803 3 : return 0;
30804 : }
30805 :
30806 : static int __Pyx_modinit_variable_export_code(void) {
30807 : __Pyx_RefNannyDeclarations
30808 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
30809 : /*--- Variable export code ---*/
30810 : __Pyx_RefNannyFinishContext();
30811 : return 0;
30812 : }
30813 :
30814 : static int __Pyx_modinit_function_export_code(void) {
30815 : __Pyx_RefNannyDeclarations
30816 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
30817 : /*--- Function export code ---*/
30818 : __Pyx_RefNannyFinishContext();
30819 : return 0;
30820 : }
30821 :
30822 3 : static int __Pyx_modinit_type_init_code(void) {
30823 : __Pyx_RefNannyDeclarations
30824 3 : PyObject *__pyx_t_1 = NULL;
30825 3 : int __pyx_lineno = 0;
30826 3 : const char *__pyx_filename = NULL;
30827 3 : int __pyx_clineno = 0;
30828 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
30829 : /*--- Type init code ---*/
30830 3 : __pyx_vtabptr_array = &__pyx_vtable_array;
30831 3 : __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
30832 : #if CYTHON_USE_TYPE_SPECS
30833 : __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(1, 114, __pyx_L1_error)
30834 : #if !CYTHON_COMPILING_IN_LIMITED_API
30835 : __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
30836 : if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
30837 : __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
30838 : }
30839 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
30840 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
30841 : #elif defined(_MSC_VER)
30842 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
30843 : #else
30844 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
30845 : #endif
30846 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
30847 : #else
30848 3 : __pyx_array_type = &__pyx_type___pyx_array;
30849 : #endif
30850 : #if !CYTHON_COMPILING_IN_LIMITED_API
30851 : #endif
30852 : #if !CYTHON_USE_TYPE_SPECS
30853 3 : if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
30854 : #endif
30855 : #if PY_MAJOR_VERSION < 3
30856 : __pyx_array_type->tp_print = 0;
30857 : #endif
30858 3 : if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
30859 : #if !CYTHON_COMPILING_IN_LIMITED_API
30860 3 : if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
30861 : #endif
30862 : #if !CYTHON_COMPILING_IN_LIMITED_API
30863 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
30864 : #endif
30865 : #if CYTHON_USE_TYPE_SPECS
30866 : __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(1, 302, __pyx_L1_error)
30867 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
30868 : #else
30869 3 : __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
30870 : #endif
30871 : #if !CYTHON_COMPILING_IN_LIMITED_API
30872 : #endif
30873 : #if !CYTHON_USE_TYPE_SPECS
30874 3 : if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
30875 : #endif
30876 : #if PY_MAJOR_VERSION < 3
30877 : __pyx_MemviewEnum_type->tp_print = 0;
30878 : #endif
30879 : #if !CYTHON_COMPILING_IN_LIMITED_API
30880 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
30881 3 : __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
30882 : }
30883 : #endif
30884 : #if !CYTHON_COMPILING_IN_LIMITED_API
30885 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
30886 : #endif
30887 3 : __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
30888 3 : __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
30889 3 : __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
30890 3 : __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
30891 3 : __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
30892 3 : __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
30893 3 : __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
30894 3 : __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
30895 3 : __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
30896 : #if CYTHON_USE_TYPE_SPECS
30897 : __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(1, 337, __pyx_L1_error)
30898 : #if !CYTHON_COMPILING_IN_LIMITED_API
30899 : __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
30900 : if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
30901 : __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
30902 : }
30903 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
30904 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
30905 : #elif defined(_MSC_VER)
30906 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
30907 : #else
30908 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
30909 : #endif
30910 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
30911 : #else
30912 3 : __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
30913 : #endif
30914 : #if !CYTHON_COMPILING_IN_LIMITED_API
30915 : #endif
30916 : #if !CYTHON_USE_TYPE_SPECS
30917 3 : if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
30918 : #endif
30919 : #if PY_MAJOR_VERSION < 3
30920 : __pyx_memoryview_type->tp_print = 0;
30921 : #endif
30922 : #if !CYTHON_COMPILING_IN_LIMITED_API
30923 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
30924 3 : __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
30925 : }
30926 : #endif
30927 3 : if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
30928 : #if !CYTHON_COMPILING_IN_LIMITED_API
30929 3 : if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
30930 : #endif
30931 : #if !CYTHON_COMPILING_IN_LIMITED_API
30932 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
30933 : #endif
30934 3 : __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
30935 3 : __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
30936 3 : __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
30937 3 : __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
30938 3 : __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
30939 : #if CYTHON_USE_TYPE_SPECS
30940 : __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 952, __pyx_L1_error)
30941 : __Pyx_GOTREF(__pyx_t_1);
30942 : __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
30943 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
30944 : if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(1, 952, __pyx_L1_error)
30945 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
30946 : #else
30947 3 : __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
30948 : #endif
30949 : #if !CYTHON_COMPILING_IN_LIMITED_API
30950 3 : __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type;
30951 : #endif
30952 : #if !CYTHON_USE_TYPE_SPECS
30953 3 : if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
30954 : #endif
30955 : #if PY_MAJOR_VERSION < 3
30956 : __pyx_memoryviewslice_type->tp_print = 0;
30957 : #endif
30958 : #if !CYTHON_COMPILING_IN_LIMITED_API
30959 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
30960 3 : __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
30961 : }
30962 : #endif
30963 3 : if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
30964 : #if !CYTHON_COMPILING_IN_LIMITED_API
30965 3 : if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
30966 : #endif
30967 : #if !CYTHON_COMPILING_IN_LIMITED_API
30968 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
30969 : #endif
30970 : __Pyx_RefNannyFinishContext();
30971 : return 0;
30972 0 : __pyx_L1_error:;
30973 0 : __Pyx_XDECREF(__pyx_t_1);
30974 0 : __Pyx_RefNannyFinishContext();
30975 0 : return -1;
30976 : }
30977 :
30978 3 : static int __Pyx_modinit_type_import_code(void) {
30979 : __Pyx_RefNannyDeclarations
30980 3 : PyObject *__pyx_t_1 = NULL;
30981 3 : int __pyx_lineno = 0;
30982 3 : const char *__pyx_filename = NULL;
30983 3 : int __pyx_clineno = 0;
30984 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
30985 : /*--- Type import code ---*/
30986 3 : __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
30987 3 : __Pyx_GOTREF(__pyx_t_1);
30988 3 : __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
30989 : #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
30990 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
30991 : #elif CYTHON_COMPILING_IN_LIMITED_API
30992 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
30993 : #else
30994 : sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
30995 : #endif
30996 3 : __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
30997 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30998 3 : __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error)
30999 3 : __Pyx_GOTREF(__pyx_t_1);
31000 3 : __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error)
31001 3 : __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error)
31002 3 : __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error)
31003 3 : __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error)
31004 3 : __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
31005 3 : __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
31006 3 : __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
31007 3 : __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
31008 3 : __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
31009 3 : __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
31010 3 : __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
31011 3 : __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
31012 3 : __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
31013 3 : __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
31014 3 : __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error)
31015 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31016 : __Pyx_RefNannyFinishContext();
31017 : return 0;
31018 0 : __pyx_L1_error:;
31019 0 : __Pyx_XDECREF(__pyx_t_1);
31020 0 : __Pyx_RefNannyFinishContext();
31021 0 : return -1;
31022 : }
31023 :
31024 : static int __Pyx_modinit_variable_import_code(void) {
31025 : __Pyx_RefNannyDeclarations
31026 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
31027 : /*--- Variable import code ---*/
31028 : __Pyx_RefNannyFinishContext();
31029 : return 0;
31030 : }
31031 :
31032 : static int __Pyx_modinit_function_import_code(void) {
31033 : __Pyx_RefNannyDeclarations
31034 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
31035 : /*--- Function import code ---*/
31036 : __Pyx_RefNannyFinishContext();
31037 : return 0;
31038 : }
31039 :
31040 :
31041 : #if PY_MAJOR_VERSION >= 3
31042 : #if CYTHON_PEP489_MULTI_PHASE_INIT
31043 : static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
31044 : static int __pyx_pymod_exec__bspl(PyObject* module); /*proto*/
31045 : static PyModuleDef_Slot __pyx_moduledef_slots[] = {
31046 : {Py_mod_create, (void*)__pyx_pymod_create},
31047 : {Py_mod_exec, (void*)__pyx_pymod_exec__bspl},
31048 : {0, NULL}
31049 : };
31050 : #endif
31051 :
31052 : #ifdef __cplusplus
31053 : namespace {
31054 : struct PyModuleDef __pyx_moduledef =
31055 : #else
31056 : static struct PyModuleDef __pyx_moduledef =
31057 : #endif
31058 : {
31059 : PyModuleDef_HEAD_INIT,
31060 : "_bspl",
31061 : __pyx_k_Routines_for_evaluating_and_man, /* m_doc */
31062 : #if CYTHON_PEP489_MULTI_PHASE_INIT
31063 : 0, /* m_size */
31064 : #elif CYTHON_USE_MODULE_STATE
31065 : sizeof(__pyx_mstate), /* m_size */
31066 : #else
31067 : -1, /* m_size */
31068 : #endif
31069 : __pyx_methods /* m_methods */,
31070 : #if CYTHON_PEP489_MULTI_PHASE_INIT
31071 : __pyx_moduledef_slots, /* m_slots */
31072 : #else
31073 : NULL, /* m_reload */
31074 : #endif
31075 : #if CYTHON_USE_MODULE_STATE
31076 : __pyx_m_traverse, /* m_traverse */
31077 : __pyx_m_clear, /* m_clear */
31078 : NULL /* m_free */
31079 : #else
31080 : NULL, /* m_traverse */
31081 : NULL, /* m_clear */
31082 : NULL /* m_free */
31083 : #endif
31084 : };
31085 : #ifdef __cplusplus
31086 : } /* anonymous namespace */
31087 : #endif
31088 : #endif
31089 :
31090 : #ifndef CYTHON_NO_PYINIT_EXPORT
31091 : #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
31092 : #elif PY_MAJOR_VERSION < 3
31093 : #ifdef __cplusplus
31094 : #define __Pyx_PyMODINIT_FUNC extern "C" void
31095 : #else
31096 : #define __Pyx_PyMODINIT_FUNC void
31097 : #endif
31098 : #else
31099 : #ifdef __cplusplus
31100 : #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
31101 : #else
31102 : #define __Pyx_PyMODINIT_FUNC PyObject *
31103 : #endif
31104 : #endif
31105 :
31106 :
31107 : #if PY_MAJOR_VERSION < 3
31108 : __Pyx_PyMODINIT_FUNC init_bspl(void) CYTHON_SMALL_CODE; /*proto*/
31109 : __Pyx_PyMODINIT_FUNC init_bspl(void)
31110 : #else
31111 : __Pyx_PyMODINIT_FUNC PyInit__bspl(void) CYTHON_SMALL_CODE; /*proto*/
31112 3 : __Pyx_PyMODINIT_FUNC PyInit__bspl(void)
31113 : #if CYTHON_PEP489_MULTI_PHASE_INIT
31114 : {
31115 3 : return PyModuleDef_Init(&__pyx_moduledef);
31116 : }
31117 3 : static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
31118 : #if PY_VERSION_HEX >= 0x030700A1
31119 3 : static PY_INT64_T main_interpreter_id = -1;
31120 3 : PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
31121 3 : if (main_interpreter_id == -1) {
31122 3 : main_interpreter_id = current_id;
31123 6 : return (unlikely(current_id == -1)) ? -1 : 0;
31124 0 : } else if (unlikely(main_interpreter_id != current_id))
31125 : #else
31126 : static PyInterpreterState *main_interpreter = NULL;
31127 : PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
31128 : if (!main_interpreter) {
31129 : main_interpreter = current_interpreter;
31130 : } else if (unlikely(main_interpreter != current_interpreter))
31131 : #endif
31132 : {
31133 0 : PyErr_SetString(
31134 : PyExc_ImportError,
31135 : "Interpreter change detected - this module can only be loaded into one interpreter per process.");
31136 0 : return -1;
31137 : }
31138 : return 0;
31139 : }
31140 : #if CYTHON_COMPILING_IN_LIMITED_API
31141 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
31142 : #else
31143 12 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
31144 : #endif
31145 : {
31146 12 : PyObject *value = PyObject_GetAttrString(spec, from_name);
31147 12 : int result = 0;
31148 12 : if (likely(value)) {
31149 12 : if (allow_none || value != Py_None) {
31150 : #if CYTHON_COMPILING_IN_LIMITED_API
31151 : result = PyModule_AddObject(module, to_name, value);
31152 : #else
31153 9 : result = PyDict_SetItemString(moddict, to_name, value);
31154 : #endif
31155 : }
31156 12 : Py_DECREF(value);
31157 0 : } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
31158 0 : PyErr_Clear();
31159 : } else {
31160 : result = -1;
31161 : }
31162 12 : return result;
31163 : }
31164 3 : static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
31165 3 : PyObject *module = NULL, *moddict, *modname;
31166 3 : CYTHON_UNUSED_VAR(def);
31167 3 : if (__Pyx_check_single_interpreter())
31168 : return NULL;
31169 3 : if (__pyx_m)
31170 0 : return __Pyx_NewRef(__pyx_m);
31171 3 : modname = PyObject_GetAttrString(spec, "name");
31172 3 : if (unlikely(!modname)) goto bad;
31173 3 : module = PyModule_NewObject(modname);
31174 3 : Py_DECREF(modname);
31175 3 : if (unlikely(!module)) goto bad;
31176 : #if CYTHON_COMPILING_IN_LIMITED_API
31177 : moddict = module;
31178 : #else
31179 3 : moddict = PyModule_GetDict(module);
31180 3 : if (unlikely(!moddict)) goto bad;
31181 : #endif
31182 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
31183 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
31184 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
31185 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
31186 : return module;
31187 0 : bad:
31188 0 : Py_XDECREF(module);
31189 0 : return NULL;
31190 : }
31191 :
31192 :
31193 3 : static CYTHON_SMALL_CODE int __pyx_pymod_exec__bspl(PyObject *__pyx_pyinit_module)
31194 : #endif
31195 : #endif
31196 : {
31197 3 : int stringtab_initialized = 0;
31198 : #if CYTHON_USE_MODULE_STATE
31199 : int pystate_addmodule_run = 0;
31200 : #endif
31201 3 : PyObject *__pyx_t_1 = NULL;
31202 3 : PyObject *__pyx_t_2 = NULL;
31203 3 : PyObject *__pyx_t_3 = NULL;
31204 3 : PyObject *__pyx_t_4 = NULL;
31205 3 : PyObject *__pyx_t_5 = NULL;
31206 3 : int __pyx_t_6;
31207 3 : PyObject *__pyx_t_7 = NULL;
31208 3 : static PyThread_type_lock __pyx_t_8[8];
31209 3 : int __pyx_t_9;
31210 3 : int __pyx_lineno = 0;
31211 3 : const char *__pyx_filename = NULL;
31212 3 : int __pyx_clineno = 0;
31213 : __Pyx_RefNannyDeclarations
31214 : #if CYTHON_PEP489_MULTI_PHASE_INIT
31215 3 : if (__pyx_m) {
31216 0 : if (__pyx_m == __pyx_pyinit_module) return 0;
31217 0 : PyErr_SetString(PyExc_RuntimeError, "Module '_bspl' has already been imported. Re-initialisation is not supported.");
31218 0 : return -1;
31219 : }
31220 : #elif PY_MAJOR_VERSION >= 3
31221 : if (__pyx_m) return __Pyx_NewRef(__pyx_m);
31222 : #endif
31223 : /*--- Module creation code ---*/
31224 : #if CYTHON_PEP489_MULTI_PHASE_INIT
31225 3 : __pyx_m = __pyx_pyinit_module;
31226 3 : Py_INCREF(__pyx_m);
31227 : #else
31228 : #if PY_MAJOR_VERSION < 3
31229 : __pyx_m = Py_InitModule4("_bspl", __pyx_methods, __pyx_k_Routines_for_evaluating_and_man, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
31230 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
31231 : #elif CYTHON_USE_MODULE_STATE
31232 : __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
31233 : {
31234 : int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
31235 : __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_bspl" pseudovariable */
31236 : if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
31237 : pystate_addmodule_run = 1;
31238 : }
31239 : #else
31240 : __pyx_m = PyModule_Create(&__pyx_moduledef);
31241 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
31242 : #endif
31243 : #endif
31244 3 : CYTHON_UNUSED_VAR(__pyx_t_1);
31245 3 : __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
31246 3 : Py_INCREF(__pyx_d);
31247 3 : __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
31248 3 : __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
31249 3 : if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31250 : #if CYTHON_REFNANNY
31251 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
31252 : if (!__Pyx_RefNanny) {
31253 : PyErr_Clear();
31254 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
31255 : if (!__Pyx_RefNanny)
31256 : Py_FatalError("failed to import 'refnanny' module");
31257 : }
31258 : #endif
31259 3 : __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__bspl(void)", 0);
31260 3 : if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31261 : #ifdef __Pxy_PyFrame_Initialize_Offsets
31262 : __Pxy_PyFrame_Initialize_Offsets();
31263 : #endif
31264 3 : __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
31265 3 : __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
31266 3 : __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
31267 : #ifdef __Pyx_CyFunction_USED
31268 3 : if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31269 : #endif
31270 : #ifdef __Pyx_FusedFunction_USED
31271 3 : if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31272 : #endif
31273 : #ifdef __Pyx_Coroutine_USED
31274 : if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31275 : #endif
31276 : #ifdef __Pyx_Generator_USED
31277 : if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31278 : #endif
31279 : #ifdef __Pyx_AsyncGen_USED
31280 : if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31281 : #endif
31282 : #ifdef __Pyx_StopAsyncIteration_USED
31283 : if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31284 : #endif
31285 : /*--- Library function declarations ---*/
31286 : /*--- Threads initialization code ---*/
31287 : #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
31288 : PyEval_InitThreads();
31289 : #endif
31290 : /*--- Initialize various global constants etc. ---*/
31291 3 : if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31292 3 : stringtab_initialized = 1;
31293 3 : if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31294 : #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
31295 : if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31296 : #endif
31297 3 : if (__pyx_module_is_main_scipy__interpolate___bspl) {
31298 0 : if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31299 : }
31300 : #if PY_MAJOR_VERSION >= 3
31301 3 : {
31302 3 : PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
31303 3 : if (!PyDict_GetItemString(modules, "scipy.interpolate._bspl")) {
31304 0 : if (unlikely((PyDict_SetItemString(modules, "scipy.interpolate._bspl", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
31305 : }
31306 : }
31307 : #endif
31308 : /*--- Builtin init code ---*/
31309 3 : if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31310 : /*--- Constants init code ---*/
31311 3 : if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31312 : /*--- Global type/function init code ---*/
31313 3 : (void)__Pyx_modinit_global_init_code();
31314 3 : (void)__Pyx_modinit_variable_export_code();
31315 3 : (void)__Pyx_modinit_function_export_code();
31316 3 : if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
31317 3 : if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
31318 3 : (void)__Pyx_modinit_variable_import_code();
31319 3 : (void)__Pyx_modinit_function_import_code();
31320 : /*--- Execution code ---*/
31321 : #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
31322 : if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
31323 : #endif
31324 :
31325 : /* "View.MemoryView":99
31326 : *
31327 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
31328 : * try: # <<<<<<<<<<<<<<
31329 : * if __import__("sys").version_info >= (3, 3):
31330 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
31331 : */
31332 3 : {
31333 3 : __Pyx_PyThreadState_declare
31334 3 : __Pyx_PyThreadState_assign
31335 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
31336 3 : __Pyx_XGOTREF(__pyx_t_1);
31337 3 : __Pyx_XGOTREF(__pyx_t_2);
31338 3 : __Pyx_XGOTREF(__pyx_t_3);
31339 3 : /*try:*/ {
31340 :
31341 : /* "View.MemoryView":100
31342 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
31343 : * try:
31344 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
31345 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
31346 : * else:
31347 : */
31348 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
31349 3 : __Pyx_GOTREF(__pyx_t_4);
31350 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 100, __pyx_L2_error)
31351 3 : __Pyx_GOTREF(__pyx_t_5);
31352 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31353 3 : __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__18, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
31354 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31355 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 100, __pyx_L2_error)
31356 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31357 3 : if (__pyx_t_6) {
31358 :
31359 : /* "View.MemoryView":101
31360 : * try:
31361 : * if __import__("sys").version_info >= (3, 3):
31362 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
31363 : * else:
31364 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
31365 : */
31366 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
31367 3 : __Pyx_GOTREF(__pyx_t_4);
31368 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L2_error)
31369 3 : __Pyx_GOTREF(__pyx_t_5);
31370 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31371 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
31372 3 : __Pyx_GOTREF(__pyx_t_4);
31373 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
31374 3 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
31375 3 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
31376 3 : __Pyx_GIVEREF(__pyx_t_4);
31377 3 : __pyx_t_4 = 0;
31378 :
31379 : /* "View.MemoryView":100
31380 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
31381 : * try:
31382 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
31383 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
31384 : * else:
31385 : */
31386 3 : goto __pyx_L8;
31387 : }
31388 :
31389 : /* "View.MemoryView":103
31390 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
31391 : * else:
31392 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
31393 : * except:
31394 : *
31395 : */
31396 0 : /*else*/ {
31397 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 103, __pyx_L2_error)
31398 0 : __Pyx_GOTREF(__pyx_t_4);
31399 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 103, __pyx_L2_error)
31400 0 : __Pyx_GOTREF(__pyx_t_5);
31401 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31402 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
31403 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_5);
31404 0 : __Pyx_GIVEREF(__pyx_t_5);
31405 0 : __pyx_t_5 = 0;
31406 : }
31407 3 : __pyx_L8:;
31408 :
31409 : /* "View.MemoryView":99
31410 : *
31411 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
31412 : * try: # <<<<<<<<<<<<<<
31413 : * if __import__("sys").version_info >= (3, 3):
31414 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
31415 : */
31416 : }
31417 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
31418 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
31419 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
31420 3 : goto __pyx_L7_try_end;
31421 0 : __pyx_L2_error:;
31422 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
31423 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
31424 :
31425 : /* "View.MemoryView":104
31426 : * else:
31427 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
31428 : * except: # <<<<<<<<<<<<<<
31429 : *
31430 : * __pyx_collections_abc_Sequence = None
31431 : */
31432 0 : /*except:*/ {
31433 0 : __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
31434 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 104, __pyx_L4_except_error)
31435 0 : __Pyx_XGOTREF(__pyx_t_5);
31436 0 : __Pyx_XGOTREF(__pyx_t_4);
31437 0 : __Pyx_XGOTREF(__pyx_t_7);
31438 :
31439 : /* "View.MemoryView":106
31440 : * except:
31441 : *
31442 : * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
31443 : *
31444 : *
31445 : */
31446 0 : __Pyx_INCREF(Py_None);
31447 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
31448 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
31449 0 : __Pyx_GIVEREF(Py_None);
31450 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
31451 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
31452 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
31453 0 : goto __pyx_L3_exception_handled;
31454 : }
31455 :
31456 : /* "View.MemoryView":99
31457 : *
31458 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
31459 : * try: # <<<<<<<<<<<<<<
31460 : * if __import__("sys").version_info >= (3, 3):
31461 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
31462 : */
31463 0 : __pyx_L4_except_error:;
31464 0 : __Pyx_XGIVEREF(__pyx_t_1);
31465 0 : __Pyx_XGIVEREF(__pyx_t_2);
31466 0 : __Pyx_XGIVEREF(__pyx_t_3);
31467 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
31468 0 : goto __pyx_L1_error;
31469 0 : __pyx_L3_exception_handled:;
31470 0 : __Pyx_XGIVEREF(__pyx_t_1);
31471 0 : __Pyx_XGIVEREF(__pyx_t_2);
31472 0 : __Pyx_XGIVEREF(__pyx_t_3);
31473 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
31474 3 : __pyx_L7_try_end:;
31475 : }
31476 :
31477 : /* "View.MemoryView":241
31478 : *
31479 : *
31480 : * try: # <<<<<<<<<<<<<<
31481 : * count = __pyx_collections_abc_Sequence.count
31482 : * index = __pyx_collections_abc_Sequence.index
31483 : */
31484 3 : {
31485 3 : __Pyx_PyThreadState_declare
31486 3 : __Pyx_PyThreadState_assign
31487 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
31488 3 : __Pyx_XGOTREF(__pyx_t_3);
31489 3 : __Pyx_XGOTREF(__pyx_t_2);
31490 3 : __Pyx_XGOTREF(__pyx_t_1);
31491 3 : /*try:*/ {
31492 :
31493 : /* "View.MemoryView":242
31494 : *
31495 : * try:
31496 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
31497 : * index = __pyx_collections_abc_Sequence.index
31498 : * except:
31499 : */
31500 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 242, __pyx_L11_error)
31501 3 : __Pyx_GOTREF(__pyx_t_7);
31502 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 242, __pyx_L11_error)
31503 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31504 3 : PyType_Modified(__pyx_array_type);
31505 :
31506 : /* "View.MemoryView":243
31507 : * try:
31508 : * count = __pyx_collections_abc_Sequence.count
31509 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
31510 : * except:
31511 : * pass
31512 : */
31513 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 243, __pyx_L11_error)
31514 3 : __Pyx_GOTREF(__pyx_t_7);
31515 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 243, __pyx_L11_error)
31516 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31517 3 : PyType_Modified(__pyx_array_type);
31518 :
31519 : /* "View.MemoryView":241
31520 : *
31521 : *
31522 : * try: # <<<<<<<<<<<<<<
31523 : * count = __pyx_collections_abc_Sequence.count
31524 : * index = __pyx_collections_abc_Sequence.index
31525 : */
31526 : }
31527 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
31528 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
31529 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
31530 3 : goto __pyx_L16_try_end;
31531 0 : __pyx_L11_error:;
31532 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
31533 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
31534 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
31535 :
31536 : /* "View.MemoryView":244
31537 : * count = __pyx_collections_abc_Sequence.count
31538 : * index = __pyx_collections_abc_Sequence.index
31539 : * except: # <<<<<<<<<<<<<<
31540 : * pass
31541 : *
31542 : */
31543 0 : /*except:*/ {
31544 0 : __Pyx_ErrRestore(0,0,0);
31545 0 : goto __pyx_L12_exception_handled;
31546 : }
31547 0 : __pyx_L12_exception_handled:;
31548 0 : __Pyx_XGIVEREF(__pyx_t_3);
31549 0 : __Pyx_XGIVEREF(__pyx_t_2);
31550 0 : __Pyx_XGIVEREF(__pyx_t_1);
31551 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
31552 3 : __pyx_L16_try_end:;
31553 : }
31554 :
31555 : /* "View.MemoryView":309
31556 : * return self.name
31557 : *
31558 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
31559 : * cdef strided = Enum("<strided and direct>") # default
31560 : * cdef indirect = Enum("<strided and indirect>")
31561 : */
31562 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 309, __pyx_L1_error)
31563 3 : __Pyx_GOTREF(__pyx_t_7);
31564 3 : __Pyx_XGOTREF(generic);
31565 3 : __Pyx_DECREF_SET(generic, __pyx_t_7);
31566 3 : __Pyx_GIVEREF(__pyx_t_7);
31567 3 : __pyx_t_7 = 0;
31568 :
31569 : /* "View.MemoryView":310
31570 : *
31571 : * cdef generic = Enum("<strided and direct or indirect>")
31572 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
31573 : * cdef indirect = Enum("<strided and indirect>")
31574 : *
31575 : */
31576 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 310, __pyx_L1_error)
31577 3 : __Pyx_GOTREF(__pyx_t_7);
31578 3 : __Pyx_XGOTREF(strided);
31579 3 : __Pyx_DECREF_SET(strided, __pyx_t_7);
31580 3 : __Pyx_GIVEREF(__pyx_t_7);
31581 3 : __pyx_t_7 = 0;
31582 :
31583 : /* "View.MemoryView":311
31584 : * cdef generic = Enum("<strided and direct or indirect>")
31585 : * cdef strided = Enum("<strided and direct>") # default
31586 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
31587 : *
31588 : *
31589 : */
31590 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 311, __pyx_L1_error)
31591 3 : __Pyx_GOTREF(__pyx_t_7);
31592 3 : __Pyx_XGOTREF(indirect);
31593 3 : __Pyx_DECREF_SET(indirect, __pyx_t_7);
31594 3 : __Pyx_GIVEREF(__pyx_t_7);
31595 3 : __pyx_t_7 = 0;
31596 :
31597 : /* "View.MemoryView":314
31598 : *
31599 : *
31600 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
31601 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
31602 : *
31603 : */
31604 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 314, __pyx_L1_error)
31605 3 : __Pyx_GOTREF(__pyx_t_7);
31606 3 : __Pyx_XGOTREF(contiguous);
31607 3 : __Pyx_DECREF_SET(contiguous, __pyx_t_7);
31608 3 : __Pyx_GIVEREF(__pyx_t_7);
31609 3 : __pyx_t_7 = 0;
31610 :
31611 : /* "View.MemoryView":315
31612 : *
31613 : * cdef contiguous = Enum("<contiguous and direct>")
31614 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
31615 : *
31616 : *
31617 : */
31618 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 315, __pyx_L1_error)
31619 3 : __Pyx_GOTREF(__pyx_t_7);
31620 3 : __Pyx_XGOTREF(indirect_contiguous);
31621 3 : __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7);
31622 3 : __Pyx_GIVEREF(__pyx_t_7);
31623 3 : __pyx_t_7 = 0;
31624 :
31625 : /* "View.MemoryView":323
31626 : *
31627 : *
31628 : * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
31629 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
31630 : * PyThread_allocate_lock(),
31631 : */
31632 3 : __pyx_memoryview_thread_locks_used = 0;
31633 :
31634 : /* "View.MemoryView":324
31635 : *
31636 : * cdef int __pyx_memoryview_thread_locks_used = 0
31637 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
31638 : * PyThread_allocate_lock(),
31639 : * PyThread_allocate_lock(),
31640 : */
31641 3 : __pyx_t_8[0] = PyThread_allocate_lock();
31642 3 : __pyx_t_8[1] = PyThread_allocate_lock();
31643 3 : __pyx_t_8[2] = PyThread_allocate_lock();
31644 3 : __pyx_t_8[3] = PyThread_allocate_lock();
31645 3 : __pyx_t_8[4] = PyThread_allocate_lock();
31646 3 : __pyx_t_8[5] = PyThread_allocate_lock();
31647 3 : __pyx_t_8[6] = PyThread_allocate_lock();
31648 3 : __pyx_t_8[7] = PyThread_allocate_lock();
31649 3 : memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
31650 :
31651 : /* "View.MemoryView":982
31652 : *
31653 : *
31654 : * try: # <<<<<<<<<<<<<<
31655 : * count = __pyx_collections_abc_Sequence.count
31656 : * index = __pyx_collections_abc_Sequence.index
31657 : */
31658 3 : {
31659 3 : __Pyx_PyThreadState_declare
31660 3 : __Pyx_PyThreadState_assign
31661 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
31662 3 : __Pyx_XGOTREF(__pyx_t_1);
31663 3 : __Pyx_XGOTREF(__pyx_t_2);
31664 3 : __Pyx_XGOTREF(__pyx_t_3);
31665 3 : /*try:*/ {
31666 :
31667 : /* "View.MemoryView":983
31668 : *
31669 : * try:
31670 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
31671 : * index = __pyx_collections_abc_Sequence.index
31672 : * except:
31673 : */
31674 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 983, __pyx_L17_error)
31675 3 : __Pyx_GOTREF(__pyx_t_7);
31676 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 983, __pyx_L17_error)
31677 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31678 3 : PyType_Modified(__pyx_memoryviewslice_type);
31679 :
31680 : /* "View.MemoryView":984
31681 : * try:
31682 : * count = __pyx_collections_abc_Sequence.count
31683 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
31684 : * except:
31685 : * pass
31686 : */
31687 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 984, __pyx_L17_error)
31688 3 : __Pyx_GOTREF(__pyx_t_7);
31689 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 984, __pyx_L17_error)
31690 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31691 3 : PyType_Modified(__pyx_memoryviewslice_type);
31692 :
31693 : /* "View.MemoryView":982
31694 : *
31695 : *
31696 : * try: # <<<<<<<<<<<<<<
31697 : * count = __pyx_collections_abc_Sequence.count
31698 : * index = __pyx_collections_abc_Sequence.index
31699 : */
31700 : }
31701 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
31702 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
31703 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
31704 3 : goto __pyx_L22_try_end;
31705 0 : __pyx_L17_error:;
31706 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
31707 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
31708 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
31709 :
31710 : /* "View.MemoryView":985
31711 : * count = __pyx_collections_abc_Sequence.count
31712 : * index = __pyx_collections_abc_Sequence.index
31713 : * except: # <<<<<<<<<<<<<<
31714 : * pass
31715 : *
31716 : */
31717 0 : /*except:*/ {
31718 0 : __Pyx_ErrRestore(0,0,0);
31719 0 : goto __pyx_L18_exception_handled;
31720 : }
31721 0 : __pyx_L18_exception_handled:;
31722 0 : __Pyx_XGIVEREF(__pyx_t_1);
31723 0 : __Pyx_XGIVEREF(__pyx_t_2);
31724 0 : __Pyx_XGIVEREF(__pyx_t_3);
31725 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
31726 3 : __pyx_L22_try_end:;
31727 : }
31728 :
31729 : /* "View.MemoryView":988
31730 : * pass
31731 : *
31732 : * try: # <<<<<<<<<<<<<<
31733 : * if __pyx_collections_abc_Sequence:
31734 : *
31735 : */
31736 3 : {
31737 3 : __Pyx_PyThreadState_declare
31738 3 : __Pyx_PyThreadState_assign
31739 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
31740 3 : __Pyx_XGOTREF(__pyx_t_3);
31741 3 : __Pyx_XGOTREF(__pyx_t_2);
31742 3 : __Pyx_XGOTREF(__pyx_t_1);
31743 3 : /*try:*/ {
31744 :
31745 : /* "View.MemoryView":989
31746 : *
31747 : * try:
31748 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
31749 : *
31750 : *
31751 : */
31752 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 989, __pyx_L23_error)
31753 3 : if (__pyx_t_6) {
31754 :
31755 : /* "View.MemoryView":993
31756 : *
31757 : *
31758 : * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
31759 : * __pyx_collections_abc_Sequence.register(array)
31760 : * except:
31761 : */
31762 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 993, __pyx_L23_error)
31763 3 : __Pyx_GOTREF(__pyx_t_7);
31764 3 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 993, __pyx_L23_error)
31765 3 : __Pyx_GOTREF(__pyx_t_4);
31766 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31767 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31768 :
31769 : /* "View.MemoryView":994
31770 : *
31771 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
31772 : * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
31773 : * except:
31774 : * pass # ignore failure, it's a minor issue
31775 : */
31776 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 994, __pyx_L23_error)
31777 3 : __Pyx_GOTREF(__pyx_t_4);
31778 3 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 994, __pyx_L23_error)
31779 3 : __Pyx_GOTREF(__pyx_t_7);
31780 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31781 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31782 :
31783 : /* "View.MemoryView":989
31784 : *
31785 : * try:
31786 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
31787 : *
31788 : *
31789 : */
31790 : }
31791 :
31792 : /* "View.MemoryView":988
31793 : * pass
31794 : *
31795 : * try: # <<<<<<<<<<<<<<
31796 : * if __pyx_collections_abc_Sequence:
31797 : *
31798 : */
31799 : }
31800 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
31801 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
31802 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
31803 3 : goto __pyx_L28_try_end;
31804 0 : __pyx_L23_error:;
31805 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
31806 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
31807 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
31808 :
31809 : /* "View.MemoryView":995
31810 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
31811 : * __pyx_collections_abc_Sequence.register(array)
31812 : * except: # <<<<<<<<<<<<<<
31813 : * pass # ignore failure, it's a minor issue
31814 : *
31815 : */
31816 0 : /*except:*/ {
31817 0 : __Pyx_ErrRestore(0,0,0);
31818 0 : goto __pyx_L24_exception_handled;
31819 : }
31820 0 : __pyx_L24_exception_handled:;
31821 0 : __Pyx_XGIVEREF(__pyx_t_3);
31822 0 : __Pyx_XGIVEREF(__pyx_t_2);
31823 0 : __Pyx_XGIVEREF(__pyx_t_1);
31824 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
31825 3 : __pyx_L28_try_end:;
31826 : }
31827 :
31828 : /* "(tree fragment)":1
31829 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
31830 : * cdef object __pyx_PickleError
31831 : * cdef object __pyx_result
31832 : */
31833 3 : __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error)
31834 3 : __Pyx_GOTREF(__pyx_t_7);
31835 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
31836 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31837 :
31838 : /* "scipy/interpolate/_bspl.pyx":6
31839 : * """
31840 : *
31841 : * import numpy as np # <<<<<<<<<<<<<<
31842 : * cimport numpy as cnp
31843 : *
31844 : */
31845 3 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 6, __pyx_L1_error)
31846 3 : __Pyx_GOTREF(__pyx_t_7);
31847 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 6, __pyx_L1_error)
31848 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31849 :
31850 : /* "scipy/interpolate/_bspl.pyx":14
31851 : * from libc.math cimport NAN
31852 : *
31853 : * cnp.import_array() # <<<<<<<<<<<<<<
31854 : *
31855 : * cdef extern from "src/__fitpack.h" namespace "fitpack":
31856 : */
31857 3 : __pyx_t_9 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 14, __pyx_L1_error)
31858 :
31859 : /* "scipy/interpolate/_bspl.pyx":98
31860 : * # NB: a python wrapper for find_interval. The leading underscore signals
31861 : * # it's not meant to be user-visible outside of _bsplines.py
31862 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
31863 : * @cython.boundscheck(False)
31864 : * def _py_find_interval(const double[::1] t,
31865 : */
31866 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_1_py_find_interval, 0, __pyx_n_s_py_find_interval, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 98, __pyx_L1_error)
31867 3 : __Pyx_GOTREF(__pyx_t_7);
31868 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_find_interval, __pyx_t_7) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
31869 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31870 :
31871 : /* "scipy/interpolate/_bspl.pyx":108
31872 : *
31873 : *
31874 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
31875 : * @cython.boundscheck(False)
31876 : * @cython.cdivision(True)
31877 : */
31878 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_3evaluate_spline, 0, __pyx_n_s_evaluate_spline, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 108, __pyx_L1_error)
31879 3 : __Pyx_GOTREF(__pyx_t_7);
31880 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluate_spline, __pyx_t_7) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
31881 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31882 :
31883 : /* "scipy/interpolate/_bspl.pyx":181
31884 : *
31885 : *
31886 : * def evaluate_all_bspl(const double[::1] t, int k, double xval, int m, int nu=0): # <<<<<<<<<<<<<<
31887 : * """Evaluate the ``k+1`` B-splines which are non-zero on interval ``m``.
31888 : *
31889 : */
31890 3 : __pyx_t_7 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error)
31891 3 : __Pyx_GOTREF(__pyx_t_7);
31892 3 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 181, __pyx_L1_error)
31893 3 : __Pyx_GOTREF(__pyx_t_4);
31894 3 : __Pyx_GIVEREF(__pyx_t_7);
31895 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error);
31896 3 : __pyx_t_7 = 0;
31897 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_5evaluate_all_bspl, 0, __pyx_n_s_evaluate_all_bspl, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error)
31898 3 : __Pyx_GOTREF(__pyx_t_7);
31899 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_4);
31900 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31901 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluate_all_bspl, __pyx_t_7) < 0) __PYX_ERR(0, 181, __pyx_L1_error)
31902 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31903 :
31904 : /* "scipy/interpolate/_bspl.pyx":245
31905 : * @cython.boundscheck(False)
31906 : * def _colloc(const double[::1] x, const double[::1] t, int k, double[::1, :] ab,
31907 : * int offset=0): # <<<<<<<<<<<<<<
31908 : * """Build the B-spline collocation matrix.
31909 : *
31910 : */
31911 3 : __pyx_t_7 = __Pyx_PyInt_From_int(((int)0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 245, __pyx_L1_error)
31912 3 : __Pyx_GOTREF(__pyx_t_7);
31913 :
31914 : /* "scipy/interpolate/_bspl.pyx":242
31915 : *
31916 : *
31917 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
31918 : * @cython.boundscheck(False)
31919 : * def _colloc(const double[::1] x, const double[::1] t, int k, double[::1, :] ab,
31920 : */
31921 3 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
31922 3 : __Pyx_GOTREF(__pyx_t_4);
31923 3 : __Pyx_GIVEREF(__pyx_t_7);
31924 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error);
31925 3 : __pyx_t_7 = 0;
31926 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_7_colloc, 0, __pyx_n_s_colloc, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error)
31927 3 : __Pyx_GOTREF(__pyx_t_7);
31928 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_4);
31929 6 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31930 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_colloc, __pyx_t_7) < 0) __PYX_ERR(0, 242, __pyx_L1_error)
31931 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31932 :
31933 : /* "scipy/interpolate/_bspl.pyx":303
31934 : *
31935 : *
31936 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
31937 : * @cython.boundscheck(False)
31938 : * def _norm_eq_lsq(const double[::1] x,
31939 : */
31940 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_9_norm_eq_lsq, 0, __pyx_n_s_norm_eq_lsq, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error)
31941 3 : __Pyx_GOTREF(__pyx_t_7);
31942 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_norm_eq_lsq, __pyx_t_7) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
31943 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
31944 :
31945 : /* "scipy/interpolate/_bspl.pyx":383
31946 : * rhs[row, ci] = rhs[row, ci] + wrk[r] * y[j, ci] * wval
31947 : *
31948 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
31949 : * @cython.boundscheck(False)
31950 : * def _make_design_matrix(const double[::1] x,
31951 : */
31952 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 383, __pyx_L1_error)
31953 3 : __Pyx_GOTREF(__pyx_t_7);
31954 3 : __pyx_t_4 = __pyx_FusedFunction_New(&__pyx_fuse_0__pyx_mdef_5scipy_11interpolate_5_bspl_25_make_design_matrix, 0, __pyx_n_s_make_design_matrix, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error)
31955 3 : __Pyx_GOTREF(__pyx_t_4);
31956 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
31957 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_npy_int32, __pyx_t_4) < 0) __PYX_ERR(0, 383, __pyx_L1_error)
31958 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31959 3 : __pyx_t_4 = __pyx_FusedFunction_New(&__pyx_fuse_1__pyx_mdef_5scipy_11interpolate_5_bspl_27_make_design_matrix, 0, __pyx_n_s_make_design_matrix, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error)
31960 3 : __Pyx_GOTREF(__pyx_t_4);
31961 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
31962 3 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_npy_int64, __pyx_t_4) < 0) __PYX_ERR(0, 383, __pyx_L1_error)
31963 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31964 3 : __pyx_t_4 = __pyx_FusedFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_11_make_design_matrix, 0, __pyx_n_s_make_design_matrix, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error)
31965 3 : __Pyx_GOTREF(__pyx_t_4);
31966 3 : if (!__Pyx_CyFunction_InitDefaults(__pyx_t_4, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 383, __pyx_L1_error)
31967 3 : __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error)
31968 3 : __Pyx_GOTREF(__pyx_t_5);
31969 3 : __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_4)->__pyx_arg__fused_sigindex = __pyx_t_5;
31970 3 : __Pyx_GIVEREF(__pyx_t_5);
31971 3 : __pyx_t_5 = 0;
31972 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
31973 3 : ((__pyx_FusedFunctionObject *) __pyx_t_4)->__signatures__ = __pyx_t_7;
31974 3 : __Pyx_GIVEREF(__pyx_t_7);
31975 3 : __pyx_t_7 = 0;
31976 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_design_matrix, __pyx_t_4) < 0) __PYX_ERR(0, 383, __pyx_L1_error)
31977 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31978 :
31979 : /* "scipy/interpolate/_bspl.pyx":446
31980 : *
31981 : *
31982 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
31983 : * @cython.boundscheck(False)
31984 : * @cython.nonecheck(False)
31985 : */
31986 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_13evaluate_ndbspline, 0, __pyx_n_s_evaluate_ndbspline, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 446, __pyx_L1_error)
31987 3 : __Pyx_GOTREF(__pyx_t_4);
31988 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluate_ndbspline, __pyx_t_4) < 0) __PYX_ERR(0, 446, __pyx_L1_error)
31989 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31990 :
31991 : /* "scipy/interpolate/_bspl.pyx":641
31992 : *
31993 : *
31994 : * @cython.wraparound(False) # <<<<<<<<<<<<<<
31995 : * @cython.nonecheck(False)
31996 : * @cython.boundscheck(False)
31997 : */
31998 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_15_colloc_nd, 0, __pyx_n_s_colloc_nd, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error)
31999 3 : __Pyx_GOTREF(__pyx_t_4);
32000 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_colloc_nd, __pyx_t_4) < 0) __PYX_ERR(0, 641, __pyx_L1_error)
32001 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32002 :
32003 : /* "scipy/interpolate/_bspl.pyx":798
32004 : * def _qr_reduce(double[:, ::1] a, ssize_t[::1] offset, ssize_t nc, # A packed
32005 : * double[:, ::1] y,
32006 : * ssize_t startrow=1 # <<<<<<<<<<<<<<
32007 : * ):
32008 : * # (A, offset, nc) is a PackedMatrix instance, unpacked
32009 : */
32010 3 : __pyx_t_4 = PyInt_FromSsize_t(((Py_ssize_t)1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error)
32011 3 : __Pyx_GOTREF(__pyx_t_4);
32012 :
32013 : /* "scipy/interpolate/_bspl.pyx":796
32014 : * # wrappers for fitpack repro
32015 : * # ---------------------------
32016 : * def _qr_reduce(double[:, ::1] a, ssize_t[::1] offset, ssize_t nc, # A packed # <<<<<<<<<<<<<<
32017 : * double[:, ::1] y,
32018 : * ssize_t startrow=1
32019 : */
32020 3 : __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 796, __pyx_L1_error)
32021 3 : __Pyx_GOTREF(__pyx_t_7);
32022 3 : __Pyx_GIVEREF(__pyx_t_4);
32023 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error);
32024 3 : __pyx_t_4 = 0;
32025 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_17_qr_reduce, 0, __pyx_n_s_qr_reduce, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error)
32026 3 : __Pyx_GOTREF(__pyx_t_4);
32027 6 : __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_t_7);
32028 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32029 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_qr_reduce, __pyx_t_4) < 0) __PYX_ERR(0, 796, __pyx_L1_error)
32030 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32031 :
32032 : /* "scipy/interpolate/_bspl.pyx":808
32033 : *
32034 : *
32035 : * def _data_matrix(const double[::1] x, # <<<<<<<<<<<<<<
32036 : * const double[::1] t,
32037 : * int k,
32038 : */
32039 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_19_data_matrix, 0, __pyx_n_s_data_matrix, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
32040 3 : __Pyx_GOTREF(__pyx_t_4);
32041 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_data_matrix, __pyx_t_4) < 0) __PYX_ERR(0, 808, __pyx_L1_error)
32042 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32043 :
32044 : /* "scipy/interpolate/_bspl.pyx":834
32045 : *
32046 : *
32047 : * def _fpback(const double[:, ::1] R, ssize_t nc, # (R, offset, nc) triangular => offset is range(nc) # <<<<<<<<<<<<<<
32048 : * const double[:, ::1] y
32049 : * ):
32050 : */
32051 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_21_fpback, 0, __pyx_n_s_fpback, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error)
32052 3 : __Pyx_GOTREF(__pyx_t_4);
32053 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_fpback, __pyx_t_4) < 0) __PYX_ERR(0, 834, __pyx_L1_error)
32054 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32055 :
32056 : /* "scipy/interpolate/_bspl.pyx":856
32057 : *
32058 : *
32059 : * def _fpknot(const double[::1] x, # <<<<<<<<<<<<<<
32060 : * const double[::1] t,
32061 : * int k,
32062 : */
32063 3 : __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_11interpolate_5_bspl_23_fpknot, 0, __pyx_n_s_fpknot, NULL, __pyx_n_s_scipy_interpolate__bspl, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
32064 3 : __Pyx_GOTREF(__pyx_t_4);
32065 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_fpknot, __pyx_t_4) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
32066 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32067 :
32068 : /* "scipy/interpolate/_bspl.pyx":1
32069 : * """ # <<<<<<<<<<<<<<
32070 : * Routines for evaluating and manipulating B-splines.
32071 : *
32072 : */
32073 3 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
32074 3 : __Pyx_GOTREF(__pyx_t_4);
32075 3 : if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_evaluate_all_bspl_line_181, __pyx_kp_u_Evaluate_the_k_1_B_splines_which) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32076 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32077 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
32078 :
32079 : /*--- Wrapped vars code ---*/
32080 :
32081 3 : goto __pyx_L0;
32082 0 : __pyx_L1_error:;
32083 0 : __Pyx_XDECREF(__pyx_t_4);
32084 0 : __Pyx_XDECREF(__pyx_t_5);
32085 0 : __Pyx_XDECREF(__pyx_t_7);
32086 0 : if (__pyx_m) {
32087 0 : if (__pyx_d && stringtab_initialized) {
32088 0 : __Pyx_AddTraceback("init scipy.interpolate._bspl", __pyx_clineno, __pyx_lineno, __pyx_filename);
32089 : }
32090 : #if !CYTHON_USE_MODULE_STATE
32091 0 : Py_CLEAR(__pyx_m);
32092 : #else
32093 : Py_DECREF(__pyx_m);
32094 : if (pystate_addmodule_run) {
32095 : PyObject *tp, *value, *tb;
32096 : PyErr_Fetch(&tp, &value, &tb);
32097 : PyState_RemoveModule(&__pyx_moduledef);
32098 : PyErr_Restore(tp, value, tb);
32099 : }
32100 : #endif
32101 0 : } else if (!PyErr_Occurred()) {
32102 0 : PyErr_SetString(PyExc_ImportError, "init scipy.interpolate._bspl");
32103 : }
32104 0 : __pyx_L0:;
32105 3 : __Pyx_RefNannyFinishContext();
32106 : #if CYTHON_PEP489_MULTI_PHASE_INIT
32107 3 : return (__pyx_m != NULL) ? 0 : -1;
32108 : #elif PY_MAJOR_VERSION >= 3
32109 : return __pyx_m;
32110 : #else
32111 : return;
32112 : #endif
32113 : }
32114 : /* #### Code section: cleanup_globals ### */
32115 : /* #### Code section: cleanup_module ### */
32116 : /* #### Code section: main_method ### */
32117 : /* #### Code section: utility_code_pragmas ### */
32118 : #ifdef _MSC_VER
32119 : #pragma warning( push )
32120 : /* Warning 4127: conditional expression is constant
32121 : * Cython uses constant conditional expressions to allow in inline functions to be optimized at
32122 : * compile-time, so this warning is not useful
32123 : */
32124 : #pragma warning( disable : 4127 )
32125 : #endif
32126 :
32127 :
32128 :
32129 : /* #### Code section: utility_code_def ### */
32130 :
32131 : /* --- Runtime support code --- */
32132 : /* Refnanny */
32133 : #if CYTHON_REFNANNY
32134 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
32135 : PyObject *m = NULL, *p = NULL;
32136 : void *r = NULL;
32137 : m = PyImport_ImportModule(modname);
32138 : if (!m) goto end;
32139 : p = PyObject_GetAttrString(m, "RefNannyAPI");
32140 : if (!p) goto end;
32141 : r = PyLong_AsVoidPtr(p);
32142 : end:
32143 : Py_XDECREF(p);
32144 : Py_XDECREF(m);
32145 : return (__Pyx_RefNannyAPIStruct *)r;
32146 : }
32147 : #endif
32148 :
32149 : /* PyErrExceptionMatches */
32150 : #if CYTHON_FAST_THREAD_STATE
32151 0 : static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
32152 0 : Py_ssize_t i, n;
32153 0 : n = PyTuple_GET_SIZE(tuple);
32154 : #if PY_MAJOR_VERSION >= 3
32155 0 : for (i=0; i<n; i++) {
32156 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
32157 : }
32158 : #endif
32159 0 : for (i=0; i<n; i++) {
32160 0 : if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
32161 : }
32162 : return 0;
32163 : }
32164 9 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
32165 9 : int result;
32166 9 : PyObject *exc_type;
32167 : #if PY_VERSION_HEX >= 0x030C00A6
32168 9 : PyObject *current_exception = tstate->current_exception;
32169 9 : if (unlikely(!current_exception)) return 0;
32170 9 : exc_type = (PyObject*) Py_TYPE(current_exception);
32171 9 : if (exc_type == err) return 1;
32172 : #else
32173 : exc_type = tstate->curexc_type;
32174 : if (exc_type == err) return 1;
32175 : if (unlikely(!exc_type)) return 0;
32176 : #endif
32177 : #if CYTHON_AVOID_BORROWED_REFS
32178 : Py_INCREF(exc_type);
32179 : #endif
32180 0 : if (unlikely(PyTuple_Check(err))) {
32181 0 : result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
32182 : } else {
32183 0 : result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
32184 : }
32185 : #if CYTHON_AVOID_BORROWED_REFS
32186 : Py_DECREF(exc_type);
32187 : #endif
32188 : return result;
32189 : }
32190 : #endif
32191 :
32192 : /* PyErrFetchRestore */
32193 : #if CYTHON_FAST_THREAD_STATE
32194 2094 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
32195 : #if PY_VERSION_HEX >= 0x030C00A6
32196 2094 : PyObject *tmp_value;
32197 2094 : assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
32198 2094 : if (value) {
32199 : #if CYTHON_COMPILING_IN_CPYTHON
32200 2085 : if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
32201 : #endif
32202 0 : PyException_SetTraceback(value, tb);
32203 : }
32204 2094 : tmp_value = tstate->current_exception;
32205 2094 : tstate->current_exception = value;
32206 2094 : Py_XDECREF(tmp_value);
32207 2094 : Py_XDECREF(type);
32208 2094 : Py_XDECREF(tb);
32209 : #else
32210 : PyObject *tmp_type, *tmp_value, *tmp_tb;
32211 : tmp_type = tstate->curexc_type;
32212 : tmp_value = tstate->curexc_value;
32213 : tmp_tb = tstate->curexc_traceback;
32214 : tstate->curexc_type = type;
32215 : tstate->curexc_value = value;
32216 : tstate->curexc_traceback = tb;
32217 : Py_XDECREF(tmp_type);
32218 : Py_XDECREF(tmp_value);
32219 : Py_XDECREF(tmp_tb);
32220 : #endif
32221 2094 : }
32222 2085 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
32223 : #if PY_VERSION_HEX >= 0x030C00A6
32224 2085 : PyObject* exc_value;
32225 2085 : exc_value = tstate->current_exception;
32226 2085 : tstate->current_exception = 0;
32227 2085 : *value = exc_value;
32228 2085 : *type = NULL;
32229 2085 : *tb = NULL;
32230 2085 : if (exc_value) {
32231 2085 : *type = (PyObject*) Py_TYPE(exc_value);
32232 2085 : Py_INCREF(*type);
32233 : #if CYTHON_COMPILING_IN_CPYTHON
32234 2085 : *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
32235 2085 : Py_XINCREF(*tb);
32236 : #else
32237 : *tb = PyException_GetTraceback(exc_value);
32238 : #endif
32239 : }
32240 : #else
32241 : *type = tstate->curexc_type;
32242 : *value = tstate->curexc_value;
32243 : *tb = tstate->curexc_traceback;
32244 : tstate->curexc_type = 0;
32245 : tstate->curexc_value = 0;
32246 : tstate->curexc_traceback = 0;
32247 : #endif
32248 2085 : }
32249 : #endif
32250 :
32251 : /* PyObjectGetAttrStr */
32252 : #if CYTHON_USE_TYPE_SLOTS
32253 34252 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
32254 34252 : PyTypeObject* tp = Py_TYPE(obj);
32255 34252 : if (likely(tp->tp_getattro))
32256 34252 : return tp->tp_getattro(obj, attr_name);
32257 : #if PY_MAJOR_VERSION < 3
32258 : if (likely(tp->tp_getattr))
32259 : return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
32260 : #endif
32261 0 : return PyObject_GetAttr(obj, attr_name);
32262 : }
32263 : #endif
32264 :
32265 : /* PyObjectGetAttrStrNoError */
32266 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
32267 9 : static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
32268 9 : __Pyx_PyThreadState_declare
32269 9 : __Pyx_PyThreadState_assign
32270 9 : if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
32271 9 : __Pyx_PyErr_Clear();
32272 9 : }
32273 : #endif
32274 87 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
32275 87 : PyObject *result;
32276 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
32277 : (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
32278 : return result;
32279 : #else
32280 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
32281 87 : PyTypeObject* tp = Py_TYPE(obj);
32282 87 : if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
32283 9 : return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
32284 : }
32285 : #endif
32286 78 : result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
32287 78 : if (unlikely(!result)) {
32288 9 : __Pyx_PyObject_GetAttrStr_ClearAttributeError();
32289 : }
32290 : return result;
32291 : #endif
32292 : }
32293 :
32294 : /* GetBuiltinName */
32295 39 : static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
32296 39 : PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
32297 39 : if (unlikely(!result) && !PyErr_Occurred()) {
32298 0 : PyErr_Format(PyExc_NameError,
32299 : #if PY_MAJOR_VERSION >= 3
32300 : "name '%U' is not defined", name);
32301 : #else
32302 : "name '%.200s' is not defined", PyString_AS_STRING(name));
32303 : #endif
32304 : }
32305 39 : return result;
32306 : }
32307 :
32308 : /* TupleAndListFromArray */
32309 : #if CYTHON_COMPILING_IN_CPYTHON
32310 : static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
32311 : PyObject *v;
32312 : Py_ssize_t i;
32313 : for (i = 0; i < length; i++) {
32314 : v = dest[i] = src[i];
32315 : Py_INCREF(v);
32316 : }
32317 : }
32318 : static CYTHON_INLINE PyObject *
32319 : __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
32320 : {
32321 : PyObject *res;
32322 : if (n <= 0) {
32323 : Py_INCREF(__pyx_empty_tuple);
32324 : return __pyx_empty_tuple;
32325 : }
32326 : res = PyTuple_New(n);
32327 : if (unlikely(res == NULL)) return NULL;
32328 : __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
32329 : return res;
32330 : }
32331 : static CYTHON_INLINE PyObject *
32332 : __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
32333 : {
32334 : PyObject *res;
32335 : if (n <= 0) {
32336 : return PyList_New(0);
32337 : }
32338 : res = PyList_New(n);
32339 : if (unlikely(res == NULL)) return NULL;
32340 : __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
32341 : return res;
32342 : }
32343 : #endif
32344 :
32345 : /* BytesEquals */
32346 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
32347 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
32348 : return PyObject_RichCompareBool(s1, s2, equals);
32349 : #else
32350 : if (s1 == s2) {
32351 : return (equals == Py_EQ);
32352 : } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
32353 : const char *ps1, *ps2;
32354 : Py_ssize_t length = PyBytes_GET_SIZE(s1);
32355 : if (length != PyBytes_GET_SIZE(s2))
32356 : return (equals == Py_NE);
32357 : ps1 = PyBytes_AS_STRING(s1);
32358 : ps2 = PyBytes_AS_STRING(s2);
32359 : if (ps1[0] != ps2[0]) {
32360 : return (equals == Py_NE);
32361 : } else if (length == 1) {
32362 : return (equals == Py_EQ);
32363 : } else {
32364 : int result;
32365 : #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
32366 : Py_hash_t hash1, hash2;
32367 : hash1 = ((PyBytesObject*)s1)->ob_shash;
32368 : hash2 = ((PyBytesObject*)s2)->ob_shash;
32369 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
32370 : return (equals == Py_NE);
32371 : }
32372 : #endif
32373 : result = memcmp(ps1, ps2, (size_t)length);
32374 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
32375 : }
32376 : } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
32377 : return (equals == Py_NE);
32378 : } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
32379 : return (equals == Py_NE);
32380 : } else {
32381 : int result;
32382 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
32383 : if (!py_result)
32384 : return -1;
32385 : result = __Pyx_PyObject_IsTrue(py_result);
32386 : Py_DECREF(py_result);
32387 : return result;
32388 : }
32389 : #endif
32390 : }
32391 :
32392 : /* UnicodeEquals */
32393 0 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
32394 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
32395 : return PyObject_RichCompareBool(s1, s2, equals);
32396 : #else
32397 : #if PY_MAJOR_VERSION < 3
32398 : PyObject* owned_ref = NULL;
32399 : #endif
32400 0 : int s1_is_unicode, s2_is_unicode;
32401 0 : if (s1 == s2) {
32402 0 : goto return_eq;
32403 : }
32404 0 : s1_is_unicode = PyUnicode_CheckExact(s1);
32405 0 : s2_is_unicode = PyUnicode_CheckExact(s2);
32406 : #if PY_MAJOR_VERSION < 3
32407 : if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
32408 : owned_ref = PyUnicode_FromObject(s2);
32409 : if (unlikely(!owned_ref))
32410 : return -1;
32411 : s2 = owned_ref;
32412 : s2_is_unicode = 1;
32413 : } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
32414 : owned_ref = PyUnicode_FromObject(s1);
32415 : if (unlikely(!owned_ref))
32416 : return -1;
32417 : s1 = owned_ref;
32418 : s1_is_unicode = 1;
32419 : } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
32420 : return __Pyx_PyBytes_Equals(s1, s2, equals);
32421 : }
32422 : #endif
32423 0 : if (s1_is_unicode & s2_is_unicode) {
32424 0 : Py_ssize_t length;
32425 0 : int kind;
32426 0 : void *data1, *data2;
32427 0 : if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
32428 : return -1;
32429 0 : length = __Pyx_PyUnicode_GET_LENGTH(s1);
32430 0 : if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
32431 0 : goto return_ne;
32432 : }
32433 : #if CYTHON_USE_UNICODE_INTERNALS
32434 0 : {
32435 0 : Py_hash_t hash1, hash2;
32436 : #if CYTHON_PEP393_ENABLED
32437 0 : hash1 = ((PyASCIIObject*)s1)->hash;
32438 0 : hash2 = ((PyASCIIObject*)s2)->hash;
32439 : #else
32440 : hash1 = ((PyUnicodeObject*)s1)->hash;
32441 : hash2 = ((PyUnicodeObject*)s2)->hash;
32442 : #endif
32443 0 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
32444 0 : goto return_ne;
32445 : }
32446 : }
32447 : #endif
32448 0 : kind = __Pyx_PyUnicode_KIND(s1);
32449 0 : if (kind != __Pyx_PyUnicode_KIND(s2)) {
32450 0 : goto return_ne;
32451 : }
32452 0 : data1 = __Pyx_PyUnicode_DATA(s1);
32453 0 : data2 = __Pyx_PyUnicode_DATA(s2);
32454 0 : if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
32455 0 : goto return_ne;
32456 0 : } else if (length == 1) {
32457 0 : goto return_eq;
32458 : } else {
32459 0 : int result = memcmp(data1, data2, (size_t)(length * kind));
32460 : #if PY_MAJOR_VERSION < 3
32461 : Py_XDECREF(owned_ref);
32462 : #endif
32463 0 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
32464 : }
32465 0 : } else if ((s1 == Py_None) & s2_is_unicode) {
32466 0 : goto return_ne;
32467 0 : } else if ((s2 == Py_None) & s1_is_unicode) {
32468 0 : goto return_ne;
32469 : } else {
32470 0 : int result;
32471 0 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
32472 : #if PY_MAJOR_VERSION < 3
32473 : Py_XDECREF(owned_ref);
32474 : #endif
32475 0 : if (!py_result)
32476 : return -1;
32477 0 : result = __Pyx_PyObject_IsTrue(py_result);
32478 0 : Py_DECREF(py_result);
32479 0 : return result;
32480 : }
32481 0 : return_eq:
32482 : #if PY_MAJOR_VERSION < 3
32483 : Py_XDECREF(owned_ref);
32484 : #endif
32485 0 : return (equals == Py_EQ);
32486 0 : return_ne:
32487 : #if PY_MAJOR_VERSION < 3
32488 : Py_XDECREF(owned_ref);
32489 : #endif
32490 0 : return (equals == Py_NE);
32491 : #endif
32492 : }
32493 :
32494 : /* fastcall */
32495 : #if CYTHON_METH_FASTCALL
32496 3802 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
32497 : {
32498 3802 : Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
32499 3802 : for (i = 0; i < n; i++)
32500 : {
32501 3802 : if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
32502 : }
32503 0 : for (i = 0; i < n; i++)
32504 : {
32505 0 : int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
32506 0 : if (unlikely(eq != 0)) {
32507 0 : if (unlikely(eq < 0)) return NULL;
32508 0 : return kwvalues[i];
32509 : }
32510 : }
32511 : return NULL;
32512 : }
32513 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
32514 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
32515 : Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
32516 : PyObject *dict;
32517 : dict = PyDict_New();
32518 : if (unlikely(!dict))
32519 : return NULL;
32520 : for (i=0; i<nkwargs; i++) {
32521 : PyObject *key = PyTuple_GET_ITEM(kwnames, i);
32522 : if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
32523 : goto bad;
32524 : }
32525 : return dict;
32526 : bad:
32527 : Py_DECREF(dict);
32528 : return NULL;
32529 : }
32530 : #endif
32531 : #endif
32532 :
32533 : /* RaiseArgTupleInvalid */
32534 0 : static void __Pyx_RaiseArgtupleInvalid(
32535 : const char* func_name,
32536 : int exact,
32537 : Py_ssize_t num_min,
32538 : Py_ssize_t num_max,
32539 : Py_ssize_t num_found)
32540 : {
32541 0 : Py_ssize_t num_expected;
32542 0 : const char *more_or_less;
32543 0 : if (num_found < num_min) {
32544 : num_expected = num_min;
32545 : more_or_less = "at least";
32546 : } else {
32547 0 : num_expected = num_max;
32548 0 : more_or_less = "at most";
32549 : }
32550 0 : if (exact) {
32551 0 : more_or_less = "exactly";
32552 : }
32553 0 : PyErr_Format(PyExc_TypeError,
32554 : "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
32555 : func_name, more_or_less, num_expected,
32556 : (num_expected == 1) ? "" : "s", num_found);
32557 0 : }
32558 :
32559 : /* RaiseDoubleKeywords */
32560 0 : static void __Pyx_RaiseDoubleKeywordsError(
32561 : const char* func_name,
32562 : PyObject* kw_name)
32563 : {
32564 0 : PyErr_Format(PyExc_TypeError,
32565 : #if PY_MAJOR_VERSION >= 3
32566 : "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
32567 : #else
32568 : "%s() got multiple values for keyword argument '%s'", func_name,
32569 : PyString_AsString(kw_name));
32570 : #endif
32571 : }
32572 :
32573 : /* ParseKeywords */
32574 0 : static int __Pyx_ParseOptionalKeywords(
32575 : PyObject *kwds,
32576 : PyObject *const *kwvalues,
32577 : PyObject **argnames[],
32578 : PyObject *kwds2,
32579 : PyObject *values[],
32580 : Py_ssize_t num_pos_args,
32581 : const char* function_name)
32582 : {
32583 0 : PyObject *key = 0, *value = 0;
32584 0 : Py_ssize_t pos = 0;
32585 0 : PyObject*** name;
32586 0 : PyObject*** first_kw_arg = argnames + num_pos_args;
32587 0 : int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
32588 0 : while (1) {
32589 0 : Py_XDECREF(key); key = NULL;
32590 0 : Py_XDECREF(value); value = NULL;
32591 0 : if (kwds_is_tuple) {
32592 0 : Py_ssize_t size;
32593 : #if CYTHON_ASSUME_SAFE_MACROS
32594 0 : size = PyTuple_GET_SIZE(kwds);
32595 : #else
32596 : size = PyTuple_Size(kwds);
32597 : if (size < 0) goto bad;
32598 : #endif
32599 0 : if (pos >= size) break;
32600 : #if CYTHON_AVOID_BORROWED_REFS
32601 : key = __Pyx_PySequence_ITEM(kwds, pos);
32602 : if (!key) goto bad;
32603 : #elif CYTHON_ASSUME_SAFE_MACROS
32604 0 : key = PyTuple_GET_ITEM(kwds, pos);
32605 : #else
32606 : key = PyTuple_GetItem(kwds, pos);
32607 : if (!key) goto bad;
32608 : #endif
32609 0 : value = kwvalues[pos];
32610 0 : pos++;
32611 : }
32612 : else
32613 : {
32614 0 : if (!PyDict_Next(kwds, &pos, &key, &value)) break;
32615 : #if CYTHON_AVOID_BORROWED_REFS
32616 : Py_INCREF(key);
32617 : #endif
32618 : }
32619 0 : name = first_kw_arg;
32620 0 : while (*name && (**name != key)) name++;
32621 0 : if (*name) {
32622 0 : values[name-argnames] = value;
32623 : #if CYTHON_AVOID_BORROWED_REFS
32624 : Py_INCREF(value);
32625 : Py_DECREF(key);
32626 : #endif
32627 0 : key = NULL;
32628 0 : value = NULL;
32629 0 : continue;
32630 : }
32631 : #if !CYTHON_AVOID_BORROWED_REFS
32632 0 : Py_INCREF(key);
32633 : #endif
32634 0 : Py_INCREF(value);
32635 0 : name = first_kw_arg;
32636 : #if PY_MAJOR_VERSION < 3
32637 : if (likely(PyString_Check(key))) {
32638 : while (*name) {
32639 : if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
32640 : && _PyString_Eq(**name, key)) {
32641 : values[name-argnames] = value;
32642 : #if CYTHON_AVOID_BORROWED_REFS
32643 : value = NULL;
32644 : #endif
32645 : break;
32646 : }
32647 : name++;
32648 : }
32649 : if (*name) continue;
32650 : else {
32651 : PyObject*** argname = argnames;
32652 : while (argname != first_kw_arg) {
32653 : if ((**argname == key) || (
32654 : (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
32655 : && _PyString_Eq(**argname, key))) {
32656 : goto arg_passed_twice;
32657 : }
32658 : argname++;
32659 : }
32660 : }
32661 : } else
32662 : #endif
32663 0 : if (likely(PyUnicode_Check(key))) {
32664 0 : while (*name) {
32665 0 : int cmp = (
32666 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
32667 0 : (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
32668 : #endif
32669 0 : PyUnicode_Compare(**name, key)
32670 0 : );
32671 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
32672 0 : if (cmp == 0) {
32673 0 : values[name-argnames] = value;
32674 : #if CYTHON_AVOID_BORROWED_REFS
32675 : value = NULL;
32676 : #endif
32677 0 : break;
32678 : }
32679 0 : name++;
32680 : }
32681 0 : if (*name) continue;
32682 : else {
32683 : PyObject*** argname = argnames;
32684 0 : while (argname != first_kw_arg) {
32685 0 : int cmp = (**argname == key) ? 0 :
32686 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
32687 0 : (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
32688 : #endif
32689 0 : PyUnicode_Compare(**argname, key);
32690 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
32691 0 : if (cmp == 0) goto arg_passed_twice;
32692 0 : argname++;
32693 : }
32694 : }
32695 : } else
32696 0 : goto invalid_keyword_type;
32697 0 : if (kwds2) {
32698 0 : if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
32699 : } else {
32700 0 : goto invalid_keyword;
32701 : }
32702 : }
32703 0 : Py_XDECREF(key);
32704 0 : Py_XDECREF(value);
32705 : return 0;
32706 0 : arg_passed_twice:
32707 0 : __Pyx_RaiseDoubleKeywordsError(function_name, key);
32708 0 : goto bad;
32709 0 : invalid_keyword_type:
32710 0 : PyErr_Format(PyExc_TypeError,
32711 : "%.200s() keywords must be strings", function_name);
32712 0 : goto bad;
32713 0 : invalid_keyword:
32714 : #if PY_MAJOR_VERSION < 3
32715 : PyErr_Format(PyExc_TypeError,
32716 : "%.200s() got an unexpected keyword argument '%.200s'",
32717 : function_name, PyString_AsString(key));
32718 : #else
32719 0 : PyErr_Format(PyExc_TypeError,
32720 : "%s() got an unexpected keyword argument '%U'",
32721 : function_name, key);
32722 : #endif
32723 0 : bad:
32724 0 : Py_XDECREF(key);
32725 0 : Py_XDECREF(value);
32726 : return -1;
32727 : }
32728 :
32729 : /* ArgTypeTest */
32730 0 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
32731 : {
32732 0 : __Pyx_TypeName type_name;
32733 0 : __Pyx_TypeName obj_type_name;
32734 0 : if (unlikely(!type)) {
32735 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
32736 0 : return 0;
32737 : }
32738 0 : else if (exact) {
32739 : #if PY_MAJOR_VERSION == 2
32740 : if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
32741 : #endif
32742 : }
32743 : else {
32744 0 : if (likely(__Pyx_TypeCheck(obj, type))) return 1;
32745 : }
32746 0 : type_name = __Pyx_PyType_GetName(type);
32747 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
32748 0 : PyErr_Format(PyExc_TypeError,
32749 : "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
32750 : ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
32751 0 : __Pyx_DECREF_TypeName(type_name);
32752 0 : __Pyx_DECREF_TypeName(obj_type_name);
32753 0 : return 0;
32754 : }
32755 :
32756 : /* RaiseException */
32757 : #if PY_MAJOR_VERSION < 3
32758 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
32759 : __Pyx_PyThreadState_declare
32760 : CYTHON_UNUSED_VAR(cause);
32761 : Py_XINCREF(type);
32762 : if (!value || value == Py_None)
32763 : value = NULL;
32764 : else
32765 : Py_INCREF(value);
32766 : if (!tb || tb == Py_None)
32767 : tb = NULL;
32768 : else {
32769 : Py_INCREF(tb);
32770 : if (!PyTraceBack_Check(tb)) {
32771 : PyErr_SetString(PyExc_TypeError,
32772 : "raise: arg 3 must be a traceback or None");
32773 : goto raise_error;
32774 : }
32775 : }
32776 : if (PyType_Check(type)) {
32777 : #if CYTHON_COMPILING_IN_PYPY
32778 : if (!value) {
32779 : Py_INCREF(Py_None);
32780 : value = Py_None;
32781 : }
32782 : #endif
32783 : PyErr_NormalizeException(&type, &value, &tb);
32784 : } else {
32785 : if (value) {
32786 : PyErr_SetString(PyExc_TypeError,
32787 : "instance exception may not have a separate value");
32788 : goto raise_error;
32789 : }
32790 : value = type;
32791 : type = (PyObject*) Py_TYPE(type);
32792 : Py_INCREF(type);
32793 : if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
32794 : PyErr_SetString(PyExc_TypeError,
32795 : "raise: exception class must be a subclass of BaseException");
32796 : goto raise_error;
32797 : }
32798 : }
32799 : __Pyx_PyThreadState_assign
32800 : __Pyx_ErrRestore(type, value, tb);
32801 : return;
32802 : raise_error:
32803 : Py_XDECREF(value);
32804 : Py_XDECREF(type);
32805 : Py_XDECREF(tb);
32806 : return;
32807 : }
32808 : #else
32809 695 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
32810 695 : PyObject* owned_instance = NULL;
32811 695 : if (tb == Py_None) {
32812 : tb = 0;
32813 695 : } else if (tb && !PyTraceBack_Check(tb)) {
32814 0 : PyErr_SetString(PyExc_TypeError,
32815 : "raise: arg 3 must be a traceback or None");
32816 0 : goto bad;
32817 : }
32818 695 : if (value == Py_None)
32819 0 : value = 0;
32820 695 : if (PyExceptionInstance_Check(type)) {
32821 3 : if (value) {
32822 0 : PyErr_SetString(PyExc_TypeError,
32823 : "instance exception may not have a separate value");
32824 0 : goto bad;
32825 : }
32826 : value = type;
32827 : type = (PyObject*) Py_TYPE(value);
32828 692 : } else if (PyExceptionClass_Check(type)) {
32829 692 : PyObject *instance_class = NULL;
32830 692 : if (value && PyExceptionInstance_Check(value)) {
32831 0 : instance_class = (PyObject*) Py_TYPE(value);
32832 0 : if (instance_class != type) {
32833 0 : int is_subclass = PyObject_IsSubclass(instance_class, type);
32834 0 : if (!is_subclass) {
32835 : instance_class = NULL;
32836 0 : } else if (unlikely(is_subclass == -1)) {
32837 0 : goto bad;
32838 : } else {
32839 : type = instance_class;
32840 : }
32841 : }
32842 : }
32843 : if (!instance_class) {
32844 692 : PyObject *args;
32845 692 : if (!value)
32846 0 : args = PyTuple_New(0);
32847 692 : else if (PyTuple_Check(value)) {
32848 0 : Py_INCREF(value);
32849 0 : args = value;
32850 : } else
32851 692 : args = PyTuple_Pack(1, value);
32852 692 : if (!args)
32853 0 : goto bad;
32854 692 : owned_instance = PyObject_Call(type, args, NULL);
32855 692 : Py_DECREF(args);
32856 692 : if (!owned_instance)
32857 0 : goto bad;
32858 692 : value = owned_instance;
32859 692 : if (!PyExceptionInstance_Check(value)) {
32860 0 : PyErr_Format(PyExc_TypeError,
32861 : "calling %R should have returned an instance of "
32862 : "BaseException, not %R",
32863 : type, Py_TYPE(value));
32864 0 : goto bad;
32865 : }
32866 : }
32867 : } else {
32868 0 : PyErr_SetString(PyExc_TypeError,
32869 : "raise: exception class must be a subclass of BaseException");
32870 0 : goto bad;
32871 : }
32872 695 : if (cause) {
32873 0 : PyObject *fixed_cause;
32874 0 : if (cause == Py_None) {
32875 : fixed_cause = NULL;
32876 0 : } else if (PyExceptionClass_Check(cause)) {
32877 0 : fixed_cause = PyObject_CallObject(cause, NULL);
32878 0 : if (fixed_cause == NULL)
32879 0 : goto bad;
32880 0 : } else if (PyExceptionInstance_Check(cause)) {
32881 0 : fixed_cause = cause;
32882 0 : Py_INCREF(fixed_cause);
32883 : } else {
32884 0 : PyErr_SetString(PyExc_TypeError,
32885 : "exception causes must derive from "
32886 : "BaseException");
32887 0 : goto bad;
32888 : }
32889 0 : PyException_SetCause(value, fixed_cause);
32890 : }
32891 695 : PyErr_SetObject(type, value);
32892 695 : if (tb) {
32893 : #if PY_VERSION_HEX >= 0x030C00A6
32894 0 : PyException_SetTraceback(value, tb);
32895 : #elif CYTHON_FAST_THREAD_STATE
32896 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
32897 : PyObject* tmp_tb = tstate->curexc_traceback;
32898 : if (tb != tmp_tb) {
32899 : Py_INCREF(tb);
32900 : tstate->curexc_traceback = tb;
32901 : Py_XDECREF(tmp_tb);
32902 : }
32903 : #else
32904 : PyObject *tmp_type, *tmp_value, *tmp_tb;
32905 : PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
32906 : Py_INCREF(tb);
32907 : PyErr_Restore(tmp_type, tmp_value, tb);
32908 : Py_XDECREF(tmp_tb);
32909 : #endif
32910 : }
32911 695 : bad:
32912 695 : Py_XDECREF(owned_instance);
32913 695 : return;
32914 : }
32915 : #endif
32916 :
32917 : /* PyFunctionFastCall */
32918 : #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
32919 : static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
32920 : PyObject *globals) {
32921 : PyFrameObject *f;
32922 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
32923 : PyObject **fastlocals;
32924 : Py_ssize_t i;
32925 : PyObject *result;
32926 : assert(globals != NULL);
32927 : /* XXX Perhaps we should create a specialized
32928 : PyFrame_New() that doesn't take locals, but does
32929 : take builtins without sanity checking them.
32930 : */
32931 : assert(tstate != NULL);
32932 : f = PyFrame_New(tstate, co, globals, NULL);
32933 : if (f == NULL) {
32934 : return NULL;
32935 : }
32936 : fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
32937 : for (i = 0; i < na; i++) {
32938 : Py_INCREF(*args);
32939 : fastlocals[i] = *args++;
32940 : }
32941 : result = PyEval_EvalFrameEx(f,0);
32942 : ++tstate->recursion_depth;
32943 : Py_DECREF(f);
32944 : --tstate->recursion_depth;
32945 : return result;
32946 : }
32947 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
32948 : PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
32949 : PyObject *globals = PyFunction_GET_GLOBALS(func);
32950 : PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
32951 : PyObject *closure;
32952 : #if PY_MAJOR_VERSION >= 3
32953 : PyObject *kwdefs;
32954 : #endif
32955 : PyObject *kwtuple, **k;
32956 : PyObject **d;
32957 : Py_ssize_t nd;
32958 : Py_ssize_t nk;
32959 : PyObject *result;
32960 : assert(kwargs == NULL || PyDict_Check(kwargs));
32961 : nk = kwargs ? PyDict_Size(kwargs) : 0;
32962 : #if PY_MAJOR_VERSION < 3
32963 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
32964 : return NULL;
32965 : }
32966 : #else
32967 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
32968 : return NULL;
32969 : }
32970 : #endif
32971 : if (
32972 : #if PY_MAJOR_VERSION >= 3
32973 : co->co_kwonlyargcount == 0 &&
32974 : #endif
32975 : likely(kwargs == NULL || nk == 0) &&
32976 : co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
32977 : if (argdefs == NULL && co->co_argcount == nargs) {
32978 : result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
32979 : goto done;
32980 : }
32981 : else if (nargs == 0 && argdefs != NULL
32982 : && co->co_argcount == Py_SIZE(argdefs)) {
32983 : /* function called with no arguments, but all parameters have
32984 : a default value: use default values as arguments .*/
32985 : args = &PyTuple_GET_ITEM(argdefs, 0);
32986 : result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
32987 : goto done;
32988 : }
32989 : }
32990 : if (kwargs != NULL) {
32991 : Py_ssize_t pos, i;
32992 : kwtuple = PyTuple_New(2 * nk);
32993 : if (kwtuple == NULL) {
32994 : result = NULL;
32995 : goto done;
32996 : }
32997 : k = &PyTuple_GET_ITEM(kwtuple, 0);
32998 : pos = i = 0;
32999 : while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
33000 : Py_INCREF(k[i]);
33001 : Py_INCREF(k[i+1]);
33002 : i += 2;
33003 : }
33004 : nk = i / 2;
33005 : }
33006 : else {
33007 : kwtuple = NULL;
33008 : k = NULL;
33009 : }
33010 : closure = PyFunction_GET_CLOSURE(func);
33011 : #if PY_MAJOR_VERSION >= 3
33012 : kwdefs = PyFunction_GET_KW_DEFAULTS(func);
33013 : #endif
33014 : if (argdefs != NULL) {
33015 : d = &PyTuple_GET_ITEM(argdefs, 0);
33016 : nd = Py_SIZE(argdefs);
33017 : }
33018 : else {
33019 : d = NULL;
33020 : nd = 0;
33021 : }
33022 : #if PY_MAJOR_VERSION >= 3
33023 : result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
33024 : args, (int)nargs,
33025 : k, (int)nk,
33026 : d, (int)nd, kwdefs, closure);
33027 : #else
33028 : result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
33029 : args, (int)nargs,
33030 : k, (int)nk,
33031 : d, (int)nd, closure);
33032 : #endif
33033 : Py_XDECREF(kwtuple);
33034 : done:
33035 : Py_LeaveRecursiveCall();
33036 : return result;
33037 : }
33038 : #endif
33039 :
33040 : /* PyObjectCall */
33041 : #if CYTHON_COMPILING_IN_CPYTHON
33042 92536 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
33043 92536 : PyObject *result;
33044 92536 : ternaryfunc call = Py_TYPE(func)->tp_call;
33045 92536 : if (unlikely(!call))
33046 0 : return PyObject_Call(func, arg, kw);
33047 : #if PY_MAJOR_VERSION < 3
33048 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
33049 : return NULL;
33050 : #else
33051 92536 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
33052 : return NULL;
33053 : #endif
33054 92536 : result = (*call)(func, arg, kw);
33055 92536 : Py_LeaveRecursiveCall();
33056 92536 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
33057 0 : PyErr_SetString(
33058 : PyExc_SystemError,
33059 : "NULL result without error in PyObject_Call");
33060 : }
33061 : return result;
33062 : }
33063 : #endif
33064 :
33065 : /* PyObjectCallMethO */
33066 : #if CYTHON_COMPILING_IN_CPYTHON
33067 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
33068 0 : PyObject *self, *result;
33069 0 : PyCFunction cfunc;
33070 0 : cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
33071 0 : self = __Pyx_CyOrPyCFunction_GET_SELF(func);
33072 : #if PY_MAJOR_VERSION < 3
33073 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
33074 : return NULL;
33075 : #else
33076 0 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
33077 : return NULL;
33078 : #endif
33079 0 : result = cfunc(self, arg);
33080 0 : Py_LeaveRecursiveCall();
33081 0 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
33082 0 : PyErr_SetString(
33083 : PyExc_SystemError,
33084 : "NULL result without error in PyObject_Call");
33085 : }
33086 : return result;
33087 : }
33088 : #endif
33089 :
33090 : /* PyObjectFastCall */
33091 : #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
33092 : static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
33093 : PyObject *argstuple;
33094 : PyObject *result = 0;
33095 : size_t i;
33096 : argstuple = PyTuple_New((Py_ssize_t)nargs);
33097 : if (unlikely(!argstuple)) return NULL;
33098 : for (i = 0; i < nargs; i++) {
33099 : Py_INCREF(args[i]);
33100 : if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
33101 : }
33102 : result = __Pyx_PyObject_Call(func, argstuple, kwargs);
33103 : bad:
33104 : Py_DECREF(argstuple);
33105 : return result;
33106 : }
33107 : #endif
33108 2767 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
33109 2767 : Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
33110 : #if CYTHON_COMPILING_IN_CPYTHON
33111 2767 : if (nargs == 0 && kwargs == NULL) {
33112 0 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
33113 0 : return __Pyx_PyObject_CallMethO(func, NULL);
33114 : }
33115 2767 : else if (nargs == 1 && kwargs == NULL) {
33116 2767 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
33117 0 : return __Pyx_PyObject_CallMethO(func, args[0]);
33118 : }
33119 : #endif
33120 : #if PY_VERSION_HEX < 0x030800B1
33121 : #if CYTHON_FAST_PYCCALL
33122 : if (PyCFunction_Check(func)) {
33123 : if (kwargs) {
33124 : return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
33125 : } else {
33126 : return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
33127 : }
33128 : }
33129 : #if PY_VERSION_HEX >= 0x030700A1
33130 : if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
33131 : return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
33132 : }
33133 : #endif
33134 : #endif
33135 : #if CYTHON_FAST_PYCALL
33136 : if (PyFunction_Check(func)) {
33137 : return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
33138 : }
33139 : #endif
33140 : #endif
33141 2767 : if (kwargs == NULL) {
33142 : #if CYTHON_VECTORCALL
33143 : #if PY_VERSION_HEX < 0x03090000
33144 : vectorcallfunc f = _PyVectorcall_Function(func);
33145 : #else
33146 2767 : vectorcallfunc f = PyVectorcall_Function(func);
33147 : #endif
33148 2767 : if (f) {
33149 1802 : return f(func, args, (size_t)nargs, NULL);
33150 : }
33151 : #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
33152 : if (__Pyx_CyFunction_CheckExact(func)) {
33153 : __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
33154 : if (f) return f(func, args, (size_t)nargs, NULL);
33155 : }
33156 : #endif
33157 : }
33158 965 : if (nargs == 0) {
33159 0 : return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
33160 : }
33161 : #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
33162 965 : return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
33163 : #else
33164 : return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
33165 : #endif
33166 : }
33167 :
33168 : /* RaiseUnexpectedTypeError */
33169 : static int
33170 0 : __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
33171 : {
33172 0 : __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
33173 0 : PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
33174 : expected, obj_type_name);
33175 0 : __Pyx_DECREF_TypeName(obj_type_name);
33176 0 : return 0;
33177 : }
33178 :
33179 : /* CIntToDigits */
33180 : static const char DIGIT_PAIRS_10[2*10*10+1] = {
33181 : "00010203040506070809"
33182 : "10111213141516171819"
33183 : "20212223242526272829"
33184 : "30313233343536373839"
33185 : "40414243444546474849"
33186 : "50515253545556575859"
33187 : "60616263646566676869"
33188 : "70717273747576777879"
33189 : "80818283848586878889"
33190 : "90919293949596979899"
33191 : };
33192 : static const char DIGIT_PAIRS_8[2*8*8+1] = {
33193 : "0001020304050607"
33194 : "1011121314151617"
33195 : "2021222324252627"
33196 : "3031323334353637"
33197 : "4041424344454647"
33198 : "5051525354555657"
33199 : "6061626364656667"
33200 : "7071727374757677"
33201 : };
33202 : static const char DIGITS_HEX[2*16+1] = {
33203 : "0123456789abcdef"
33204 : "0123456789ABCDEF"
33205 : };
33206 :
33207 : /* BuildPyUnicode */
33208 0 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
33209 : int prepend_sign, char padding_char) {
33210 0 : PyObject *uval;
33211 0 : Py_ssize_t uoffset = ulength - clength;
33212 : #if CYTHON_USE_UNICODE_INTERNALS
33213 0 : Py_ssize_t i;
33214 : #if CYTHON_PEP393_ENABLED
33215 0 : void *udata;
33216 0 : uval = PyUnicode_New(ulength, 127);
33217 0 : if (unlikely(!uval)) return NULL;
33218 0 : udata = PyUnicode_DATA(uval);
33219 : #else
33220 : Py_UNICODE *udata;
33221 : uval = PyUnicode_FromUnicode(NULL, ulength);
33222 : if (unlikely(!uval)) return NULL;
33223 : udata = PyUnicode_AS_UNICODE(uval);
33224 : #endif
33225 0 : if (uoffset > 0) {
33226 0 : i = 0;
33227 0 : if (prepend_sign) {
33228 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
33229 0 : i++;
33230 : }
33231 0 : for (; i < uoffset; i++) {
33232 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
33233 : }
33234 : }
33235 0 : for (i=0; i < clength; i++) {
33236 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
33237 : }
33238 : #else
33239 : {
33240 : PyObject *sign = NULL, *padding = NULL;
33241 : uval = NULL;
33242 : if (uoffset > 0) {
33243 : prepend_sign = !!prepend_sign;
33244 : if (uoffset > prepend_sign) {
33245 : padding = PyUnicode_FromOrdinal(padding_char);
33246 : if (likely(padding) && uoffset > prepend_sign + 1) {
33247 : PyObject *tmp;
33248 : PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
33249 : if (unlikely(!repeat)) goto done_or_error;
33250 : tmp = PyNumber_Multiply(padding, repeat);
33251 : Py_DECREF(repeat);
33252 : Py_DECREF(padding);
33253 : padding = tmp;
33254 : }
33255 : if (unlikely(!padding)) goto done_or_error;
33256 : }
33257 : if (prepend_sign) {
33258 : sign = PyUnicode_FromOrdinal('-');
33259 : if (unlikely(!sign)) goto done_or_error;
33260 : }
33261 : }
33262 : uval = PyUnicode_DecodeASCII(chars, clength, NULL);
33263 : if (likely(uval) && padding) {
33264 : PyObject *tmp = PyNumber_Add(padding, uval);
33265 : Py_DECREF(uval);
33266 : uval = tmp;
33267 : }
33268 : if (likely(uval) && sign) {
33269 : PyObject *tmp = PyNumber_Add(sign, uval);
33270 : Py_DECREF(uval);
33271 : uval = tmp;
33272 : }
33273 : done_or_error:
33274 : Py_XDECREF(padding);
33275 : Py_XDECREF(sign);
33276 : }
33277 : #endif
33278 : return uval;
33279 : }
33280 :
33281 : /* CIntToPyUnicode */
33282 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
33283 0 : char digits[sizeof(int)*3+2];
33284 0 : char *dpos, *end = digits + sizeof(int)*3+2;
33285 0 : const char *hex_digits = DIGITS_HEX;
33286 0 : Py_ssize_t length, ulength;
33287 0 : int prepend_sign, last_one_off;
33288 0 : int remaining;
33289 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33290 0 : #pragma GCC diagnostic push
33291 0 : #pragma GCC diagnostic ignored "-Wconversion"
33292 : #endif
33293 0 : const int neg_one = (int) -1, const_zero = (int) 0;
33294 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33295 0 : #pragma GCC diagnostic pop
33296 : #endif
33297 0 : const int is_unsigned = neg_one > const_zero;
33298 0 : if (format_char == 'X') {
33299 0 : hex_digits += 16;
33300 0 : format_char = 'x';
33301 : }
33302 0 : remaining = value;
33303 0 : last_one_off = 0;
33304 0 : dpos = end;
33305 0 : do {
33306 0 : int digit_pos;
33307 0 : switch (format_char) {
33308 0 : case 'o':
33309 0 : digit_pos = abs((int)(remaining % (8*8)));
33310 0 : remaining = (int) (remaining / (8*8));
33311 0 : dpos -= 2;
33312 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
33313 0 : last_one_off = (digit_pos < 8);
33314 0 : break;
33315 0 : case 'd':
33316 0 : digit_pos = abs((int)(remaining % (10*10)));
33317 0 : remaining = (int) (remaining / (10*10));
33318 0 : dpos -= 2;
33319 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
33320 0 : last_one_off = (digit_pos < 10);
33321 0 : break;
33322 0 : case 'x':
33323 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
33324 0 : remaining = (int) (remaining / 16);
33325 0 : break;
33326 : default:
33327 : assert(0);
33328 : break;
33329 : }
33330 0 : } while (unlikely(remaining != 0));
33331 0 : assert(!last_one_off || *dpos == '0');
33332 0 : dpos += last_one_off;
33333 0 : length = end - dpos;
33334 0 : ulength = length;
33335 0 : prepend_sign = 0;
33336 0 : if (!is_unsigned && value <= neg_one) {
33337 0 : if (padding_char == ' ' || width <= length + 1) {
33338 0 : *(--dpos) = '-';
33339 0 : ++length;
33340 : } else {
33341 : prepend_sign = 1;
33342 : }
33343 0 : ++ulength;
33344 : }
33345 0 : if (width > ulength) {
33346 : ulength = width;
33347 : }
33348 0 : if (ulength == 1) {
33349 0 : return PyUnicode_FromOrdinal(*dpos);
33350 : }
33351 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
33352 : }
33353 :
33354 : /* CIntToPyUnicode */
33355 698 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
33356 698 : char digits[sizeof(Py_ssize_t)*3+2];
33357 698 : char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
33358 698 : const char *hex_digits = DIGITS_HEX;
33359 698 : Py_ssize_t length, ulength;
33360 698 : int prepend_sign, last_one_off;
33361 698 : Py_ssize_t remaining;
33362 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33363 698 : #pragma GCC diagnostic push
33364 698 : #pragma GCC diagnostic ignored "-Wconversion"
33365 : #endif
33366 698 : const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
33367 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33368 698 : #pragma GCC diagnostic pop
33369 : #endif
33370 698 : const int is_unsigned = neg_one > const_zero;
33371 698 : if (format_char == 'X') {
33372 0 : hex_digits += 16;
33373 0 : format_char = 'x';
33374 : }
33375 698 : remaining = value;
33376 698 : last_one_off = 0;
33377 698 : dpos = end;
33378 698 : do {
33379 698 : int digit_pos;
33380 698 : switch (format_char) {
33381 0 : case 'o':
33382 0 : digit_pos = abs((int)(remaining % (8*8)));
33383 0 : remaining = (Py_ssize_t) (remaining / (8*8));
33384 0 : dpos -= 2;
33385 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
33386 0 : last_one_off = (digit_pos < 8);
33387 0 : break;
33388 698 : case 'd':
33389 698 : digit_pos = abs((int)(remaining % (10*10)));
33390 698 : remaining = (Py_ssize_t) (remaining / (10*10));
33391 698 : dpos -= 2;
33392 698 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
33393 698 : last_one_off = (digit_pos < 10);
33394 698 : break;
33395 0 : case 'x':
33396 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
33397 0 : remaining = (Py_ssize_t) (remaining / 16);
33398 0 : break;
33399 : default:
33400 : assert(0);
33401 : break;
33402 : }
33403 698 : } while (unlikely(remaining != 0));
33404 698 : assert(!last_one_off || *dpos == '0');
33405 698 : dpos += last_one_off;
33406 698 : length = end - dpos;
33407 698 : ulength = length;
33408 698 : prepend_sign = 0;
33409 698 : if (!is_unsigned && value <= neg_one) {
33410 0 : if (padding_char == ' ' || width <= length + 1) {
33411 0 : *(--dpos) = '-';
33412 0 : ++length;
33413 : } else {
33414 : prepend_sign = 1;
33415 : }
33416 0 : ++ulength;
33417 : }
33418 698 : if (width > ulength) {
33419 : ulength = width;
33420 : }
33421 698 : if (ulength == 1) {
33422 698 : return PyUnicode_FromOrdinal(*dpos);
33423 : }
33424 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
33425 : }
33426 :
33427 : /* JoinPyUnicode */
33428 695 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
33429 : Py_UCS4 max_char) {
33430 : #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33431 695 : PyObject *result_uval;
33432 695 : int result_ukind, kind_shift;
33433 695 : Py_ssize_t i, char_pos;
33434 695 : void *result_udata;
33435 695 : CYTHON_MAYBE_UNUSED_VAR(max_char);
33436 : #if CYTHON_PEP393_ENABLED
33437 695 : result_uval = PyUnicode_New(result_ulength, max_char);
33438 695 : if (unlikely(!result_uval)) return NULL;
33439 695 : result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
33440 695 : kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
33441 695 : result_udata = PyUnicode_DATA(result_uval);
33442 : #else
33443 : result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
33444 : if (unlikely(!result_uval)) return NULL;
33445 : result_ukind = sizeof(Py_UNICODE);
33446 : kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
33447 : result_udata = PyUnicode_AS_UNICODE(result_uval);
33448 : #endif
33449 695 : assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
33450 695 : char_pos = 0;
33451 2786 : for (i=0; i < value_count; i++) {
33452 2091 : int ukind;
33453 2091 : Py_ssize_t ulength;
33454 2091 : void *udata;
33455 2091 : PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
33456 2091 : if (unlikely(__Pyx_PyUnicode_READY(uval)))
33457 : goto bad;
33458 2091 : ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
33459 2091 : if (unlikely(!ulength))
33460 0 : continue;
33461 2091 : if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
33462 0 : goto overflow;
33463 2091 : ukind = __Pyx_PyUnicode_KIND(uval);
33464 2091 : udata = __Pyx_PyUnicode_DATA(uval);
33465 2091 : if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
33466 2091 : memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
33467 : } else {
33468 : #if PY_VERSION_HEX >= 0x030d0000
33469 : if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
33470 : #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
33471 0 : _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
33472 : #else
33473 : Py_ssize_t j;
33474 : for (j=0; j < ulength; j++) {
33475 : Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
33476 : __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
33477 : }
33478 : #endif
33479 : }
33480 2091 : char_pos += ulength;
33481 : }
33482 : return result_uval;
33483 0 : overflow:
33484 0 : PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
33485 0 : bad:
33486 0 : Py_DECREF(result_uval);
33487 : return NULL;
33488 : #else
33489 : CYTHON_UNUSED_VAR(max_char);
33490 : CYTHON_UNUSED_VAR(result_ulength);
33491 : CYTHON_UNUSED_VAR(value_count);
33492 : return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
33493 : #endif
33494 : }
33495 :
33496 : /* GetAttr */
33497 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
33498 : #if CYTHON_USE_TYPE_SLOTS
33499 : #if PY_MAJOR_VERSION >= 3
33500 0 : if (likely(PyUnicode_Check(n)))
33501 : #else
33502 : if (likely(PyString_Check(n)))
33503 : #endif
33504 0 : return __Pyx_PyObject_GetAttrStr(o, n);
33505 : #endif
33506 0 : return PyObject_GetAttr(o, n);
33507 : }
33508 :
33509 : /* GetItemInt */
33510 0 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
33511 0 : PyObject *r;
33512 0 : if (unlikely(!j)) return NULL;
33513 0 : r = PyObject_GetItem(o, j);
33514 0 : Py_DECREF(j);
33515 : return r;
33516 : }
33517 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
33518 : CYTHON_NCP_UNUSED int wraparound,
33519 : CYTHON_NCP_UNUSED int boundscheck) {
33520 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33521 : Py_ssize_t wrapped_i = i;
33522 : if (wraparound & unlikely(i < 0)) {
33523 : wrapped_i += PyList_GET_SIZE(o);
33524 : }
33525 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
33526 : PyObject *r = PyList_GET_ITEM(o, wrapped_i);
33527 : Py_INCREF(r);
33528 : return r;
33529 : }
33530 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
33531 : #else
33532 : return PySequence_GetItem(o, i);
33533 : #endif
33534 : }
33535 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
33536 : CYTHON_NCP_UNUSED int wraparound,
33537 : CYTHON_NCP_UNUSED int boundscheck) {
33538 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33539 0 : Py_ssize_t wrapped_i = i;
33540 0 : if (wraparound & unlikely(i < 0)) {
33541 0 : wrapped_i += PyTuple_GET_SIZE(o);
33542 : }
33543 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
33544 0 : PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
33545 0 : Py_INCREF(r);
33546 0 : return r;
33547 : }
33548 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
33549 : #else
33550 : return PySequence_GetItem(o, i);
33551 : #endif
33552 : }
33553 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
33554 : CYTHON_NCP_UNUSED int wraparound,
33555 : CYTHON_NCP_UNUSED int boundscheck) {
33556 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
33557 0 : if (is_list || PyList_CheckExact(o)) {
33558 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
33559 0 : if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
33560 0 : PyObject *r = PyList_GET_ITEM(o, n);
33561 0 : Py_INCREF(r);
33562 0 : return r;
33563 : }
33564 : }
33565 0 : else if (PyTuple_CheckExact(o)) {
33566 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
33567 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
33568 0 : PyObject *r = PyTuple_GET_ITEM(o, n);
33569 0 : Py_INCREF(r);
33570 0 : return r;
33571 : }
33572 : } else {
33573 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
33574 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
33575 0 : if (mm && mm->mp_subscript) {
33576 0 : PyObject *r, *key = PyInt_FromSsize_t(i);
33577 0 : if (unlikely(!key)) return NULL;
33578 0 : r = mm->mp_subscript(o, key);
33579 0 : Py_DECREF(key);
33580 0 : return r;
33581 : }
33582 0 : if (likely(sm && sm->sq_item)) {
33583 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
33584 0 : Py_ssize_t l = sm->sq_length(o);
33585 0 : if (likely(l >= 0)) {
33586 0 : i += l;
33587 : } else {
33588 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
33589 : return NULL;
33590 0 : PyErr_Clear();
33591 : }
33592 : }
33593 0 : return sm->sq_item(o, i);
33594 : }
33595 : }
33596 : #else
33597 : if (is_list || !PyMapping_Check(o)) {
33598 : return PySequence_GetItem(o, i);
33599 : }
33600 : #endif
33601 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
33602 : }
33603 :
33604 : /* PyObjectCallOneArg */
33605 971 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
33606 971 : PyObject *args[2] = {NULL, arg};
33607 971 : return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
33608 : }
33609 :
33610 : /* ObjectGetItem */
33611 : #if CYTHON_USE_TYPE_SLOTS
33612 0 : static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
33613 0 : PyObject *runerr = NULL;
33614 0 : Py_ssize_t key_value;
33615 0 : key_value = __Pyx_PyIndex_AsSsize_t(index);
33616 0 : if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
33617 0 : return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
33618 : }
33619 0 : if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
33620 0 : __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
33621 0 : PyErr_Clear();
33622 0 : PyErr_Format(PyExc_IndexError,
33623 : "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
33624 0 : __Pyx_DECREF_TypeName(index_type_name);
33625 : }
33626 : return NULL;
33627 : }
33628 0 : static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
33629 0 : __Pyx_TypeName obj_type_name;
33630 0 : if (likely(PyType_Check(obj))) {
33631 0 : PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
33632 0 : if (!meth) {
33633 0 : PyErr_Clear();
33634 : } else {
33635 0 : PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
33636 0 : Py_DECREF(meth);
33637 0 : return result;
33638 : }
33639 : }
33640 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
33641 0 : PyErr_Format(PyExc_TypeError,
33642 : "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
33643 0 : __Pyx_DECREF_TypeName(obj_type_name);
33644 0 : return NULL;
33645 : }
33646 0 : static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
33647 0 : PyTypeObject *tp = Py_TYPE(obj);
33648 0 : PyMappingMethods *mm = tp->tp_as_mapping;
33649 0 : PySequenceMethods *sm = tp->tp_as_sequence;
33650 0 : if (likely(mm && mm->mp_subscript)) {
33651 0 : return mm->mp_subscript(obj, key);
33652 : }
33653 0 : if (likely(sm && sm->sq_item)) {
33654 0 : return __Pyx_PyObject_GetIndex(obj, key);
33655 : }
33656 0 : return __Pyx_PyObject_GetItem_Slow(obj, key);
33657 : }
33658 : #endif
33659 :
33660 : /* KeywordStringCheck */
33661 0 : static int __Pyx_CheckKeywordStrings(
33662 : PyObject *kw,
33663 : const char* function_name,
33664 : int kw_allowed)
33665 : {
33666 0 : PyObject* key = 0;
33667 0 : Py_ssize_t pos = 0;
33668 : #if CYTHON_COMPILING_IN_PYPY
33669 : if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
33670 : goto invalid_keyword;
33671 : return 1;
33672 : #else
33673 0 : if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
33674 0 : Py_ssize_t kwsize;
33675 : #if CYTHON_ASSUME_SAFE_MACROS
33676 0 : kwsize = PyTuple_GET_SIZE(kw);
33677 : #else
33678 : kwsize = PyTuple_Size(kw);
33679 : if (kwsize < 0) return 0;
33680 : #endif
33681 0 : if (unlikely(kwsize == 0))
33682 : return 1;
33683 0 : if (!kw_allowed) {
33684 : #if CYTHON_ASSUME_SAFE_MACROS
33685 0 : key = PyTuple_GET_ITEM(kw, 0);
33686 : #else
33687 : key = PyTuple_GetItem(kw, pos);
33688 : if (!key) return 0;
33689 : #endif
33690 0 : goto invalid_keyword;
33691 : }
33692 : #if PY_VERSION_HEX < 0x03090000
33693 : for (pos = 0; pos < kwsize; pos++) {
33694 : #if CYTHON_ASSUME_SAFE_MACROS
33695 : key = PyTuple_GET_ITEM(kw, pos);
33696 : #else
33697 : key = PyTuple_GetItem(kw, pos);
33698 : if (!key) return 0;
33699 : #endif
33700 : if (unlikely(!PyUnicode_Check(key)))
33701 : goto invalid_keyword_type;
33702 : }
33703 : #endif
33704 : return 1;
33705 : }
33706 0 : while (PyDict_Next(kw, &pos, &key, 0)) {
33707 : #if PY_MAJOR_VERSION < 3
33708 : if (unlikely(!PyString_Check(key)))
33709 : #endif
33710 0 : if (unlikely(!PyUnicode_Check(key)))
33711 0 : goto invalid_keyword_type;
33712 : }
33713 0 : if (!kw_allowed && unlikely(key))
33714 0 : goto invalid_keyword;
33715 : return 1;
33716 0 : invalid_keyword_type:
33717 0 : PyErr_Format(PyExc_TypeError,
33718 : "%.200s() keywords must be strings", function_name);
33719 : return 0;
33720 : #endif
33721 0 : invalid_keyword:
33722 : #if PY_MAJOR_VERSION < 3
33723 : PyErr_Format(PyExc_TypeError,
33724 : "%.200s() got an unexpected keyword argument '%.200s'",
33725 : function_name, PyString_AsString(key));
33726 : #else
33727 0 : PyErr_Format(PyExc_TypeError,
33728 : "%s() got an unexpected keyword argument '%U'",
33729 : function_name, key);
33730 : #endif
33731 : return 0;
33732 : }
33733 :
33734 : /* DivInt[Py_ssize_t] */
33735 0 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
33736 0 : Py_ssize_t q = a / b;
33737 0 : Py_ssize_t r = a - q*b;
33738 0 : q -= ((r != 0) & ((r ^ b) < 0));
33739 0 : return q;
33740 : }
33741 :
33742 : /* GetAttr3 */
33743 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
33744 0 : static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
33745 0 : __Pyx_PyThreadState_declare
33746 0 : __Pyx_PyThreadState_assign
33747 0 : if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
33748 : return NULL;
33749 0 : __Pyx_PyErr_Clear();
33750 0 : Py_INCREF(d);
33751 : return d;
33752 : }
33753 : #endif
33754 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
33755 0 : PyObject *r;
33756 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
33757 : int res = PyObject_GetOptionalAttr(o, n, &r);
33758 : return (res != 0) ? r : __Pyx_NewRef(d);
33759 : #else
33760 : #if CYTHON_USE_TYPE_SLOTS
33761 0 : if (likely(PyString_Check(n))) {
33762 0 : r = __Pyx_PyObject_GetAttrStrNoError(o, n);
33763 0 : if (unlikely(!r) && likely(!PyErr_Occurred())) {
33764 0 : r = __Pyx_NewRef(d);
33765 : }
33766 0 : return r;
33767 : }
33768 : #endif
33769 0 : r = PyObject_GetAttr(o, n);
33770 0 : return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
33771 : #endif
33772 : }
33773 :
33774 : /* PyDictVersioning */
33775 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
33776 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
33777 : PyObject *dict = Py_TYPE(obj)->tp_dict;
33778 : return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
33779 : }
33780 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
33781 : PyObject **dictptr = NULL;
33782 : Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
33783 : if (offset) {
33784 : #if CYTHON_COMPILING_IN_CPYTHON
33785 : dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
33786 : #else
33787 : dictptr = _PyObject_GetDictPtr(obj);
33788 : #endif
33789 : }
33790 : return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
33791 : }
33792 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
33793 : PyObject *dict = Py_TYPE(obj)->tp_dict;
33794 : if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
33795 : return 0;
33796 : return obj_dict_version == __Pyx_get_object_dict_version(obj);
33797 : }
33798 : #endif
33799 :
33800 : /* GetModuleGlobalName */
33801 : #if CYTHON_USE_DICT_VERSIONS
33802 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
33803 : #else
33804 33899 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
33805 : #endif
33806 : {
33807 33899 : PyObject *result;
33808 : #if !CYTHON_AVOID_BORROWED_REFS
33809 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
33810 33899 : result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
33811 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33812 33899 : if (likely(result)) {
33813 33899 : return __Pyx_NewRef(result);
33814 0 : } else if (unlikely(PyErr_Occurred())) {
33815 : return NULL;
33816 : }
33817 : #elif CYTHON_COMPILING_IN_LIMITED_API
33818 : if (unlikely(!__pyx_m)) {
33819 : return NULL;
33820 : }
33821 : result = PyObject_GetAttr(__pyx_m, name);
33822 : if (likely(result)) {
33823 : return result;
33824 : }
33825 : #else
33826 : result = PyDict_GetItem(__pyx_d, name);
33827 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33828 : if (likely(result)) {
33829 : return __Pyx_NewRef(result);
33830 : }
33831 : #endif
33832 : #else
33833 : result = PyObject_GetItem(__pyx_d, name);
33834 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33835 : if (likely(result)) {
33836 : return __Pyx_NewRef(result);
33837 : }
33838 : PyErr_Clear();
33839 : #endif
33840 0 : return __Pyx_GetBuiltinName(name);
33841 : }
33842 :
33843 : /* RaiseTooManyValuesToUnpack */
33844 0 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
33845 0 : PyErr_Format(PyExc_ValueError,
33846 : "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
33847 0 : }
33848 :
33849 : /* RaiseNeedMoreValuesToUnpack */
33850 0 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
33851 0 : PyErr_Format(PyExc_ValueError,
33852 : "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
33853 : index, (index == 1) ? "" : "s");
33854 0 : }
33855 :
33856 : /* RaiseNoneIterError */
33857 0 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
33858 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
33859 0 : }
33860 :
33861 : /* ExtTypeTest */
33862 0 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
33863 0 : __Pyx_TypeName obj_type_name;
33864 0 : __Pyx_TypeName type_name;
33865 0 : if (unlikely(!type)) {
33866 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
33867 0 : return 0;
33868 : }
33869 0 : if (likely(__Pyx_TypeCheck(obj, type)))
33870 : return 1;
33871 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
33872 0 : type_name = __Pyx_PyType_GetName(type);
33873 0 : PyErr_Format(PyExc_TypeError,
33874 : "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
33875 : obj_type_name, type_name);
33876 0 : __Pyx_DECREF_TypeName(obj_type_name);
33877 0 : __Pyx_DECREF_TypeName(type_name);
33878 0 : return 0;
33879 : }
33880 :
33881 : /* GetTopmostException */
33882 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
33883 : static _PyErr_StackItem *
33884 15 : __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
33885 : {
33886 15 : _PyErr_StackItem *exc_info = tstate->exc_info;
33887 70 : while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
33888 70 : exc_info->previous_item != NULL)
33889 : {
33890 : exc_info = exc_info->previous_item;
33891 : }
33892 15 : return exc_info;
33893 : }
33894 : #endif
33895 :
33896 : /* SaveResetException */
33897 : #if CYTHON_FAST_THREAD_STATE
33898 15 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
33899 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
33900 15 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
33901 15 : PyObject *exc_value = exc_info->exc_value;
33902 15 : if (exc_value == NULL || exc_value == Py_None) {
33903 15 : *value = NULL;
33904 15 : *type = NULL;
33905 15 : *tb = NULL;
33906 : } else {
33907 0 : *value = exc_value;
33908 0 : Py_INCREF(*value);
33909 0 : *type = (PyObject*) Py_TYPE(exc_value);
33910 0 : Py_INCREF(*type);
33911 0 : *tb = PyException_GetTraceback(exc_value);
33912 : }
33913 : #elif CYTHON_USE_EXC_INFO_STACK
33914 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
33915 : *type = exc_info->exc_type;
33916 : *value = exc_info->exc_value;
33917 : *tb = exc_info->exc_traceback;
33918 : Py_XINCREF(*type);
33919 : Py_XINCREF(*value);
33920 : Py_XINCREF(*tb);
33921 : #else
33922 : *type = tstate->exc_type;
33923 : *value = tstate->exc_value;
33924 : *tb = tstate->exc_traceback;
33925 : Py_XINCREF(*type);
33926 : Py_XINCREF(*value);
33927 : Py_XINCREF(*tb);
33928 : #endif
33929 15 : }
33930 0 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
33931 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
33932 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
33933 0 : PyObject *tmp_value = exc_info->exc_value;
33934 0 : exc_info->exc_value = value;
33935 0 : Py_XDECREF(tmp_value);
33936 0 : Py_XDECREF(type);
33937 0 : Py_XDECREF(tb);
33938 : #else
33939 : PyObject *tmp_type, *tmp_value, *tmp_tb;
33940 : #if CYTHON_USE_EXC_INFO_STACK
33941 : _PyErr_StackItem *exc_info = tstate->exc_info;
33942 : tmp_type = exc_info->exc_type;
33943 : tmp_value = exc_info->exc_value;
33944 : tmp_tb = exc_info->exc_traceback;
33945 : exc_info->exc_type = type;
33946 : exc_info->exc_value = value;
33947 : exc_info->exc_traceback = tb;
33948 : #else
33949 : tmp_type = tstate->exc_type;
33950 : tmp_value = tstate->exc_value;
33951 : tmp_tb = tstate->exc_traceback;
33952 : tstate->exc_type = type;
33953 : tstate->exc_value = value;
33954 : tstate->exc_traceback = tb;
33955 : #endif
33956 : Py_XDECREF(tmp_type);
33957 : Py_XDECREF(tmp_value);
33958 : Py_XDECREF(tmp_tb);
33959 : #endif
33960 0 : }
33961 : #endif
33962 :
33963 : /* GetException */
33964 : #if CYTHON_FAST_THREAD_STATE
33965 0 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
33966 : #else
33967 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
33968 : #endif
33969 : {
33970 0 : PyObject *local_type = NULL, *local_value, *local_tb = NULL;
33971 : #if CYTHON_FAST_THREAD_STATE
33972 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
33973 : #if PY_VERSION_HEX >= 0x030C00A6
33974 0 : local_value = tstate->current_exception;
33975 0 : tstate->current_exception = 0;
33976 0 : if (likely(local_value)) {
33977 0 : local_type = (PyObject*) Py_TYPE(local_value);
33978 0 : Py_INCREF(local_type);
33979 0 : local_tb = PyException_GetTraceback(local_value);
33980 : }
33981 : #else
33982 : local_type = tstate->curexc_type;
33983 : local_value = tstate->curexc_value;
33984 : local_tb = tstate->curexc_traceback;
33985 : tstate->curexc_type = 0;
33986 : tstate->curexc_value = 0;
33987 : tstate->curexc_traceback = 0;
33988 : #endif
33989 : #else
33990 : PyErr_Fetch(&local_type, &local_value, &local_tb);
33991 : #endif
33992 0 : PyErr_NormalizeException(&local_type, &local_value, &local_tb);
33993 : #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
33994 0 : if (unlikely(tstate->current_exception))
33995 : #elif CYTHON_FAST_THREAD_STATE
33996 : if (unlikely(tstate->curexc_type))
33997 : #else
33998 : if (unlikely(PyErr_Occurred()))
33999 : #endif
34000 0 : goto bad;
34001 : #if PY_MAJOR_VERSION >= 3
34002 0 : if (local_tb) {
34003 0 : if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
34004 0 : goto bad;
34005 : }
34006 : #endif
34007 0 : Py_XINCREF(local_tb);
34008 0 : Py_XINCREF(local_type);
34009 0 : Py_XINCREF(local_value);
34010 0 : *type = local_type;
34011 0 : *value = local_value;
34012 0 : *tb = local_tb;
34013 : #if CYTHON_FAST_THREAD_STATE
34014 : #if CYTHON_USE_EXC_INFO_STACK
34015 0 : {
34016 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
34017 : #if PY_VERSION_HEX >= 0x030B00a4
34018 0 : tmp_value = exc_info->exc_value;
34019 0 : exc_info->exc_value = local_value;
34020 0 : tmp_type = NULL;
34021 0 : tmp_tb = NULL;
34022 0 : Py_XDECREF(local_type);
34023 0 : Py_XDECREF(local_tb);
34024 : #else
34025 : tmp_type = exc_info->exc_type;
34026 : tmp_value = exc_info->exc_value;
34027 : tmp_tb = exc_info->exc_traceback;
34028 : exc_info->exc_type = local_type;
34029 : exc_info->exc_value = local_value;
34030 : exc_info->exc_traceback = local_tb;
34031 : #endif
34032 : }
34033 : #else
34034 : tmp_type = tstate->exc_type;
34035 : tmp_value = tstate->exc_value;
34036 : tmp_tb = tstate->exc_traceback;
34037 : tstate->exc_type = local_type;
34038 : tstate->exc_value = local_value;
34039 : tstate->exc_traceback = local_tb;
34040 : #endif
34041 0 : Py_XDECREF(tmp_type);
34042 0 : Py_XDECREF(tmp_value);
34043 0 : Py_XDECREF(tmp_tb);
34044 : #else
34045 : PyErr_SetExcInfo(local_type, local_value, local_tb);
34046 : #endif
34047 : return 0;
34048 0 : bad:
34049 0 : *type = 0;
34050 0 : *value = 0;
34051 0 : *tb = 0;
34052 0 : Py_XDECREF(local_type);
34053 0 : Py_XDECREF(local_value);
34054 0 : Py_XDECREF(local_tb);
34055 : return -1;
34056 : }
34057 :
34058 : /* SwapException */
34059 : #if CYTHON_FAST_THREAD_STATE
34060 0 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
34061 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
34062 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
34063 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
34064 0 : tmp_value = exc_info->exc_value;
34065 0 : exc_info->exc_value = *value;
34066 0 : if (tmp_value == NULL || tmp_value == Py_None) {
34067 0 : Py_XDECREF(tmp_value);
34068 0 : tmp_value = NULL;
34069 0 : tmp_type = NULL;
34070 0 : tmp_tb = NULL;
34071 : } else {
34072 0 : tmp_type = (PyObject*) Py_TYPE(tmp_value);
34073 0 : Py_INCREF(tmp_type);
34074 : #if CYTHON_COMPILING_IN_CPYTHON
34075 0 : tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
34076 0 : Py_XINCREF(tmp_tb);
34077 : #else
34078 : tmp_tb = PyException_GetTraceback(tmp_value);
34079 : #endif
34080 : }
34081 : #elif CYTHON_USE_EXC_INFO_STACK
34082 : _PyErr_StackItem *exc_info = tstate->exc_info;
34083 : tmp_type = exc_info->exc_type;
34084 : tmp_value = exc_info->exc_value;
34085 : tmp_tb = exc_info->exc_traceback;
34086 : exc_info->exc_type = *type;
34087 : exc_info->exc_value = *value;
34088 : exc_info->exc_traceback = *tb;
34089 : #else
34090 : tmp_type = tstate->exc_type;
34091 : tmp_value = tstate->exc_value;
34092 : tmp_tb = tstate->exc_traceback;
34093 : tstate->exc_type = *type;
34094 : tstate->exc_value = *value;
34095 : tstate->exc_traceback = *tb;
34096 : #endif
34097 0 : *type = tmp_type;
34098 0 : *value = tmp_value;
34099 0 : *tb = tmp_tb;
34100 0 : }
34101 : #else
34102 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
34103 : PyObject *tmp_type, *tmp_value, *tmp_tb;
34104 : PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
34105 : PyErr_SetExcInfo(*type, *value, *tb);
34106 : *type = tmp_type;
34107 : *value = tmp_value;
34108 : *tb = tmp_tb;
34109 : }
34110 : #endif
34111 :
34112 : /* Import */
34113 1 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
34114 1 : PyObject *module = 0;
34115 1 : PyObject *empty_dict = 0;
34116 1 : PyObject *empty_list = 0;
34117 : #if PY_MAJOR_VERSION < 3
34118 : PyObject *py_import;
34119 : py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
34120 : if (unlikely(!py_import))
34121 : goto bad;
34122 : if (!from_list) {
34123 : empty_list = PyList_New(0);
34124 : if (unlikely(!empty_list))
34125 : goto bad;
34126 : from_list = empty_list;
34127 : }
34128 : #endif
34129 1 : empty_dict = PyDict_New();
34130 1 : if (unlikely(!empty_dict))
34131 0 : goto bad;
34132 1 : {
34133 : #if PY_MAJOR_VERSION >= 3
34134 1 : if (level == -1) {
34135 0 : if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
34136 0 : module = PyImport_ImportModuleLevelObject(
34137 : name, __pyx_d, empty_dict, from_list, 1);
34138 0 : if (unlikely(!module)) {
34139 0 : if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
34140 0 : goto bad;
34141 0 : PyErr_Clear();
34142 : }
34143 : }
34144 0 : level = 0;
34145 : }
34146 : #endif
34147 0 : if (!module) {
34148 : #if PY_MAJOR_VERSION < 3
34149 : PyObject *py_level = PyInt_FromLong(level);
34150 : if (unlikely(!py_level))
34151 : goto bad;
34152 : module = PyObject_CallFunctionObjArgs(py_import,
34153 : name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
34154 : Py_DECREF(py_level);
34155 : #else
34156 1 : module = PyImport_ImportModuleLevelObject(
34157 : name, __pyx_d, empty_dict, from_list, level);
34158 : #endif
34159 : }
34160 : }
34161 1 : bad:
34162 1 : Py_XDECREF(empty_dict);
34163 1 : Py_XDECREF(empty_list);
34164 : #if PY_MAJOR_VERSION < 3
34165 : Py_XDECREF(py_import);
34166 : #endif
34167 1 : return module;
34168 : }
34169 :
34170 : /* ImportDottedModule */
34171 : #if PY_MAJOR_VERSION >= 3
34172 0 : static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
34173 0 : PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
34174 0 : if (unlikely(PyErr_Occurred())) {
34175 0 : PyErr_Clear();
34176 : }
34177 0 : if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
34178 : partial_name = name;
34179 : } else {
34180 0 : slice = PySequence_GetSlice(parts_tuple, 0, count);
34181 0 : if (unlikely(!slice))
34182 0 : goto bad;
34183 0 : sep = PyUnicode_FromStringAndSize(".", 1);
34184 0 : if (unlikely(!sep))
34185 0 : goto bad;
34186 0 : partial_name = PyUnicode_Join(sep, slice);
34187 : }
34188 0 : PyErr_Format(
34189 : #if PY_MAJOR_VERSION < 3
34190 : PyExc_ImportError,
34191 : "No module named '%s'", PyString_AS_STRING(partial_name));
34192 : #else
34193 : #if PY_VERSION_HEX >= 0x030600B1
34194 : PyExc_ModuleNotFoundError,
34195 : #else
34196 : PyExc_ImportError,
34197 : #endif
34198 : "No module named '%U'", partial_name);
34199 : #endif
34200 0 : bad:
34201 0 : Py_XDECREF(sep);
34202 0 : Py_XDECREF(slice);
34203 0 : Py_XDECREF(partial_name);
34204 0 : return NULL;
34205 : }
34206 : #endif
34207 : #if PY_MAJOR_VERSION >= 3
34208 3 : static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
34209 3 : PyObject *imported_module;
34210 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
34211 : PyObject *modules = PyImport_GetModuleDict();
34212 : if (unlikely(!modules))
34213 : return NULL;
34214 : imported_module = __Pyx_PyDict_GetItemStr(modules, name);
34215 : Py_XINCREF(imported_module);
34216 : #else
34217 6 : imported_module = PyImport_GetModule(name);
34218 : #endif
34219 3 : return imported_module;
34220 : }
34221 : #endif
34222 : #if PY_MAJOR_VERSION >= 3
34223 0 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
34224 0 : Py_ssize_t i, nparts;
34225 0 : nparts = PyTuple_GET_SIZE(parts_tuple);
34226 0 : for (i=1; i < nparts && module; i++) {
34227 0 : PyObject *part, *submodule;
34228 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34229 0 : part = PyTuple_GET_ITEM(parts_tuple, i);
34230 : #else
34231 : part = PySequence_ITEM(parts_tuple, i);
34232 : #endif
34233 0 : submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
34234 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
34235 : Py_DECREF(part);
34236 : #endif
34237 0 : Py_DECREF(module);
34238 0 : module = submodule;
34239 : }
34240 0 : if (unlikely(!module)) {
34241 0 : return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
34242 : }
34243 : return module;
34244 : }
34245 : #endif
34246 0 : static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
34247 : #if PY_MAJOR_VERSION < 3
34248 : PyObject *module, *from_list, *star = __pyx_n_s__3;
34249 : CYTHON_UNUSED_VAR(parts_tuple);
34250 : from_list = PyList_New(1);
34251 : if (unlikely(!from_list))
34252 : return NULL;
34253 : Py_INCREF(star);
34254 : PyList_SET_ITEM(from_list, 0, star);
34255 : module = __Pyx_Import(name, from_list, 0);
34256 : Py_DECREF(from_list);
34257 : return module;
34258 : #else
34259 0 : PyObject *imported_module;
34260 0 : PyObject *module = __Pyx_Import(name, NULL, 0);
34261 0 : if (!parts_tuple || unlikely(!module))
34262 : return module;
34263 0 : imported_module = __Pyx__ImportDottedModule_Lookup(name);
34264 0 : if (likely(imported_module)) {
34265 0 : Py_DECREF(module);
34266 0 : return imported_module;
34267 : }
34268 0 : PyErr_Clear();
34269 0 : return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
34270 : #endif
34271 : }
34272 3 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
34273 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
34274 3 : PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
34275 3 : if (likely(module)) {
34276 3 : PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
34277 3 : if (likely(spec)) {
34278 3 : PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
34279 3 : if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
34280 3 : Py_DECREF(spec);
34281 : spec = NULL;
34282 : }
34283 3 : Py_XDECREF(unsafe);
34284 : }
34285 3 : if (likely(!spec)) {
34286 3 : PyErr_Clear();
34287 3 : return module;
34288 : }
34289 0 : Py_DECREF(spec);
34290 0 : Py_DECREF(module);
34291 0 : } else if (PyErr_Occurred()) {
34292 0 : PyErr_Clear();
34293 : }
34294 : #endif
34295 0 : return __Pyx__ImportDottedModule(name, parts_tuple);
34296 : }
34297 :
34298 : /* FastTypeChecks */
34299 : #if CYTHON_COMPILING_IN_CPYTHON
34300 : static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
34301 0 : while (a) {
34302 0 : a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
34303 0 : if (a == b)
34304 : return 1;
34305 : }
34306 0 : return b == &PyBaseObject_Type;
34307 : }
34308 75773 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
34309 75773 : PyObject *mro;
34310 75773 : if (a == b) return 1;
34311 75718 : mro = a->tp_mro;
34312 75718 : if (likely(mro)) {
34313 75718 : Py_ssize_t i, n;
34314 75718 : n = PyTuple_GET_SIZE(mro);
34315 227154 : for (i = 0; i < n; i++) {
34316 151436 : if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
34317 : return 1;
34318 : }
34319 : return 0;
34320 : }
34321 75773 : return __Pyx_InBases(a, b);
34322 : }
34323 2767 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
34324 2767 : PyObject *mro;
34325 2767 : if (cls == a || cls == b) return 1;
34326 705 : mro = cls->tp_mro;
34327 705 : if (likely(mro)) {
34328 705 : Py_ssize_t i, n;
34329 705 : n = PyTuple_GET_SIZE(mro);
34330 2115 : for (i = 0; i < n; i++) {
34331 1410 : PyObject *base = PyTuple_GET_ITEM(mro, i);
34332 1410 : if (base == (PyObject *)a || base == (PyObject *)b)
34333 : return 1;
34334 : }
34335 : return 0;
34336 : }
34337 0 : return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
34338 : }
34339 : #if PY_MAJOR_VERSION == 2
34340 : static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
34341 : PyObject *exception, *value, *tb;
34342 : int res;
34343 : __Pyx_PyThreadState_declare
34344 : __Pyx_PyThreadState_assign
34345 : __Pyx_ErrFetch(&exception, &value, &tb);
34346 : res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
34347 : if (unlikely(res == -1)) {
34348 : PyErr_WriteUnraisable(err);
34349 : res = 0;
34350 : }
34351 : if (!res) {
34352 : res = PyObject_IsSubclass(err, exc_type2);
34353 : if (unlikely(res == -1)) {
34354 : PyErr_WriteUnraisable(err);
34355 : res = 0;
34356 : }
34357 : }
34358 : __Pyx_ErrRestore(exception, value, tb);
34359 : return res;
34360 : }
34361 : #else
34362 0 : static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
34363 0 : if (exc_type1) {
34364 0 : return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
34365 : } else {
34366 0 : return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
34367 : }
34368 : }
34369 : #endif
34370 0 : static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
34371 0 : Py_ssize_t i, n;
34372 0 : assert(PyExceptionClass_Check(exc_type));
34373 0 : n = PyTuple_GET_SIZE(tuple);
34374 : #if PY_MAJOR_VERSION >= 3
34375 0 : for (i=0; i<n; i++) {
34376 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
34377 : }
34378 : #endif
34379 0 : for (i=0; i<n; i++) {
34380 0 : PyObject *t = PyTuple_GET_ITEM(tuple, i);
34381 : #if PY_MAJOR_VERSION < 3
34382 : if (likely(exc_type == t)) return 1;
34383 : #endif
34384 0 : if (likely(PyExceptionClass_Check(t))) {
34385 0 : if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
34386 : } else {
34387 : }
34388 : }
34389 : return 0;
34390 : }
34391 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
34392 0 : if (likely(err == exc_type)) return 1;
34393 0 : if (likely(PyExceptionClass_Check(err))) {
34394 0 : if (likely(PyExceptionClass_Check(exc_type))) {
34395 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
34396 0 : } else if (likely(PyTuple_Check(exc_type))) {
34397 0 : return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
34398 : } else {
34399 : }
34400 : }
34401 0 : return PyErr_GivenExceptionMatches(err, exc_type);
34402 : }
34403 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
34404 0 : assert(PyExceptionClass_Check(exc_type1));
34405 0 : assert(PyExceptionClass_Check(exc_type2));
34406 0 : if (likely(err == exc_type1 || err == exc_type2)) return 1;
34407 0 : if (likely(PyExceptionClass_Check(err))) {
34408 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
34409 : }
34410 0 : return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
34411 : }
34412 : #endif
34413 :
34414 : /* PySequenceMultiply */
34415 0 : static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
34416 0 : PyObject *result, *pymul = PyInt_FromSsize_t(mul);
34417 0 : if (unlikely(!pymul))
34418 : return NULL;
34419 0 : result = PyNumber_Multiply(seq, pymul);
34420 0 : Py_DECREF(pymul);
34421 : return result;
34422 : }
34423 0 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
34424 : #if CYTHON_USE_TYPE_SLOTS
34425 0 : PyTypeObject *type = Py_TYPE(seq);
34426 0 : if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
34427 0 : return type->tp_as_sequence->sq_repeat(seq, mul);
34428 : } else
34429 : #endif
34430 : {
34431 0 : return __Pyx_PySequence_Multiply_Generic(seq, mul);
34432 : }
34433 : }
34434 :
34435 : /* SetItemInt */
34436 0 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
34437 0 : int r;
34438 0 : if (unlikely(!j)) return -1;
34439 0 : r = PyObject_SetItem(o, j, v);
34440 0 : Py_DECREF(j);
34441 : return r;
34442 : }
34443 2889 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
34444 : CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
34445 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
34446 2889 : if (is_list || PyList_CheckExact(o)) {
34447 2889 : Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
34448 2889 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
34449 2889 : PyObject* old = PyList_GET_ITEM(o, n);
34450 2889 : Py_INCREF(v);
34451 2889 : PyList_SET_ITEM(o, n, v);
34452 2889 : Py_DECREF(old);
34453 2889 : return 1;
34454 : }
34455 : } else {
34456 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
34457 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
34458 0 : if (mm && mm->mp_ass_subscript) {
34459 0 : int r;
34460 0 : PyObject *key = PyInt_FromSsize_t(i);
34461 0 : if (unlikely(!key)) return -1;
34462 0 : r = mm->mp_ass_subscript(o, key, v);
34463 0 : Py_DECREF(key);
34464 0 : return r;
34465 : }
34466 0 : if (likely(sm && sm->sq_ass_item)) {
34467 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
34468 0 : Py_ssize_t l = sm->sq_length(o);
34469 0 : if (likely(l >= 0)) {
34470 0 : i += l;
34471 : } else {
34472 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
34473 : return -1;
34474 0 : PyErr_Clear();
34475 : }
34476 : }
34477 0 : return sm->sq_ass_item(o, i, v);
34478 : }
34479 : }
34480 : #else
34481 : if (is_list || !PyMapping_Check(o))
34482 : {
34483 : return PySequence_SetItem(o, i, v);
34484 : }
34485 : #endif
34486 0 : return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
34487 : }
34488 :
34489 : /* RaiseUnboundLocalError */
34490 0 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
34491 0 : PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
34492 : }
34493 :
34494 : /* DivInt[long] */
34495 0 : static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
34496 0 : long q = a / b;
34497 0 : long r = a - q*b;
34498 0 : q -= ((r != 0) & ((r ^ b) < 0));
34499 0 : return q;
34500 : }
34501 :
34502 : /* ImportFrom */
34503 0 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
34504 0 : PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
34505 0 : if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
34506 0 : const char* module_name_str = 0;
34507 0 : PyObject* module_name = 0;
34508 0 : PyObject* module_dot = 0;
34509 0 : PyObject* full_name = 0;
34510 0 : PyErr_Clear();
34511 0 : module_name_str = PyModule_GetName(module);
34512 0 : if (unlikely(!module_name_str)) { goto modbad; }
34513 0 : module_name = PyUnicode_FromString(module_name_str);
34514 0 : if (unlikely(!module_name)) { goto modbad; }
34515 0 : module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2);
34516 0 : if (unlikely(!module_dot)) { goto modbad; }
34517 0 : full_name = PyUnicode_Concat(module_dot, name);
34518 0 : if (unlikely(!full_name)) { goto modbad; }
34519 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
34520 : {
34521 : PyObject *modules = PyImport_GetModuleDict();
34522 : if (unlikely(!modules))
34523 : goto modbad;
34524 : value = PyObject_GetItem(modules, full_name);
34525 : }
34526 : #else
34527 0 : value = PyImport_GetModule(full_name);
34528 : #endif
34529 0 : modbad:
34530 0 : Py_XDECREF(full_name);
34531 0 : Py_XDECREF(module_dot);
34532 0 : Py_XDECREF(module_name);
34533 : }
34534 0 : if (unlikely(!value)) {
34535 0 : PyErr_Format(PyExc_ImportError,
34536 : #if PY_MAJOR_VERSION < 3
34537 : "cannot import name %.230s", PyString_AS_STRING(name));
34538 : #else
34539 : "cannot import name %S", name);
34540 : #endif
34541 : }
34542 0 : return value;
34543 : }
34544 :
34545 : /* HasAttr */
34546 0 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
34547 0 : PyObject *r;
34548 0 : if (unlikely(!__Pyx_PyBaseString_Check(n))) {
34549 0 : PyErr_SetString(PyExc_TypeError,
34550 : "hasattr(): attribute name must be string");
34551 0 : return -1;
34552 : }
34553 0 : r = __Pyx_GetAttr(o, n);
34554 0 : if (!r) {
34555 0 : PyErr_Clear();
34556 0 : return 0;
34557 : } else {
34558 0 : Py_DECREF(r);
34559 0 : return 1;
34560 : }
34561 : }
34562 :
34563 : /* BufferIndexError */
34564 0 : static void __Pyx_RaiseBufferIndexError(int axis) {
34565 0 : PyErr_Format(PyExc_IndexError,
34566 : "Out of bounds on buffer access (axis %d)", axis);
34567 : }
34568 :
34569 : /* SliceObject */
34570 225 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
34571 : Py_ssize_t cstart, Py_ssize_t cstop,
34572 : PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
34573 : int has_cstart, int has_cstop, int wraparound) {
34574 225 : __Pyx_TypeName obj_type_name;
34575 : #if CYTHON_USE_TYPE_SLOTS
34576 225 : PyMappingMethods* mp;
34577 : #if PY_MAJOR_VERSION < 3
34578 : PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
34579 : if (likely(ms && ms->sq_slice)) {
34580 : if (!has_cstart) {
34581 : if (_py_start && (*_py_start != Py_None)) {
34582 : cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
34583 : if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
34584 : } else
34585 : cstart = 0;
34586 : }
34587 : if (!has_cstop) {
34588 : if (_py_stop && (*_py_stop != Py_None)) {
34589 : cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
34590 : if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
34591 : } else
34592 : cstop = PY_SSIZE_T_MAX;
34593 : }
34594 : if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
34595 : Py_ssize_t l = ms->sq_length(obj);
34596 : if (likely(l >= 0)) {
34597 : if (cstop < 0) {
34598 : cstop += l;
34599 : if (cstop < 0) cstop = 0;
34600 : }
34601 : if (cstart < 0) {
34602 : cstart += l;
34603 : if (cstart < 0) cstart = 0;
34604 : }
34605 : } else {
34606 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
34607 : goto bad;
34608 : PyErr_Clear();
34609 : }
34610 : }
34611 : return ms->sq_slice(obj, cstart, cstop);
34612 : }
34613 : #else
34614 225 : CYTHON_UNUSED_VAR(wraparound);
34615 : #endif
34616 225 : mp = Py_TYPE(obj)->tp_as_mapping;
34617 225 : if (likely(mp && mp->mp_subscript))
34618 : #else
34619 : CYTHON_UNUSED_VAR(wraparound);
34620 : #endif
34621 : {
34622 225 : PyObject* result;
34623 225 : PyObject *py_slice, *py_start, *py_stop;
34624 225 : if (_py_slice) {
34625 0 : py_slice = *_py_slice;
34626 : } else {
34627 225 : PyObject* owned_start = NULL;
34628 225 : PyObject* owned_stop = NULL;
34629 225 : if (_py_start) {
34630 0 : py_start = *_py_start;
34631 : } else {
34632 225 : if (has_cstart) {
34633 0 : owned_start = py_start = PyInt_FromSsize_t(cstart);
34634 0 : if (unlikely(!py_start)) goto bad;
34635 : } else
34636 : py_start = Py_None;
34637 : }
34638 225 : if (_py_stop) {
34639 0 : py_stop = *_py_stop;
34640 : } else {
34641 225 : if (has_cstop) {
34642 225 : owned_stop = py_stop = PyInt_FromSsize_t(cstop);
34643 225 : if (unlikely(!py_stop)) {
34644 0 : Py_XDECREF(owned_start);
34645 0 : goto bad;
34646 : }
34647 : } else
34648 : py_stop = Py_None;
34649 : }
34650 225 : py_slice = PySlice_New(py_start, py_stop, Py_None);
34651 225 : Py_XDECREF(owned_start);
34652 225 : Py_XDECREF(owned_stop);
34653 225 : if (unlikely(!py_slice)) goto bad;
34654 : }
34655 : #if CYTHON_USE_TYPE_SLOTS
34656 225 : result = mp->mp_subscript(obj, py_slice);
34657 : #else
34658 : result = PyObject_GetItem(obj, py_slice);
34659 : #endif
34660 225 : if (!_py_slice) {
34661 225 : Py_DECREF(py_slice);
34662 : }
34663 225 : return result;
34664 : }
34665 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
34666 0 : PyErr_Format(PyExc_TypeError,
34667 : "'" __Pyx_FMT_TYPENAME "' object is unsliceable", obj_type_name);
34668 : __Pyx_DECREF_TypeName(obj_type_name);
34669 : bad:
34670 : return NULL;
34671 : }
34672 :
34673 : /* DictGetItem */
34674 : #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
34675 55 : static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
34676 55 : PyObject *value;
34677 55 : value = PyDict_GetItemWithError(d, key);
34678 55 : if (unlikely(!value)) {
34679 0 : if (!PyErr_Occurred()) {
34680 0 : if (unlikely(PyTuple_Check(key))) {
34681 0 : PyObject* args = PyTuple_Pack(1, key);
34682 0 : if (likely(args)) {
34683 0 : PyErr_SetObject(PyExc_KeyError, args);
34684 0 : Py_DECREF(args);
34685 : }
34686 : } else {
34687 0 : PyErr_SetObject(PyExc_KeyError, key);
34688 : }
34689 : }
34690 0 : return NULL;
34691 : }
34692 55 : Py_INCREF(value);
34693 : return value;
34694 : }
34695 : #endif
34696 :
34697 : /* UnicodeAsUCS4 */
34698 55 : static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
34699 55 : Py_ssize_t length;
34700 : #if CYTHON_PEP393_ENABLED
34701 55 : length = PyUnicode_GET_LENGTH(x);
34702 55 : if (likely(length == 1)) {
34703 55 : return PyUnicode_READ_CHAR(x, 0);
34704 : }
34705 : #else
34706 : length = PyUnicode_GET_SIZE(x);
34707 : if (likely(length == 1)) {
34708 : return PyUnicode_AS_UNICODE(x)[0];
34709 : }
34710 : #if Py_UNICODE_SIZE == 2
34711 : else if (PyUnicode_GET_SIZE(x) == 2) {
34712 : Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
34713 : if (high_val >= 0xD800 && high_val <= 0xDBFF) {
34714 : Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
34715 : if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
34716 : return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
34717 : }
34718 : }
34719 : }
34720 : #endif
34721 : #endif
34722 0 : PyErr_Format(PyExc_ValueError,
34723 : "only single character unicode strings can be converted to Py_UCS4, "
34724 : "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
34725 0 : return (Py_UCS4)-1;
34726 : }
34727 :
34728 : /* object_ord */
34729 0 : static long __Pyx__PyObject_Ord(PyObject* c) {
34730 0 : Py_ssize_t size;
34731 0 : if (PyBytes_Check(c)) {
34732 0 : size = PyBytes_GET_SIZE(c);
34733 0 : if (likely(size == 1)) {
34734 0 : return (unsigned char) PyBytes_AS_STRING(c)[0];
34735 : }
34736 : #if PY_MAJOR_VERSION < 3
34737 : } else if (PyUnicode_Check(c)) {
34738 : return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
34739 : #endif
34740 : #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
34741 0 : } else if (PyByteArray_Check(c)) {
34742 0 : size = PyByteArray_GET_SIZE(c);
34743 0 : if (likely(size == 1)) {
34744 0 : return (unsigned char) PyByteArray_AS_STRING(c)[0];
34745 : }
34746 : #endif
34747 : } else {
34748 0 : __Pyx_TypeName c_type_name = __Pyx_PyType_GetName(Py_TYPE(c));
34749 0 : PyErr_Format(PyExc_TypeError,
34750 : "ord() expected string of length 1, but " __Pyx_FMT_TYPENAME " found",
34751 : c_type_name);
34752 0 : __Pyx_DECREF_TypeName(c_type_name);
34753 0 : return (long)(Py_UCS4)-1;
34754 : }
34755 0 : PyErr_Format(PyExc_TypeError,
34756 : "ord() expected a character, but string of length %zd found", size);
34757 0 : return (long)(Py_UCS4)-1;
34758 : }
34759 :
34760 : /* memoryview_get_from_buffer */
34761 : #if !CYTHON_COMPILING_IN_LIMITED_API || CYTHON_LIMITED_API >= 0x030b0000
34762 : #else
34763 : static Py_ssize_t __Pyx_PyMemoryView_Get_itemsize(PyObject *obj) {
34764 : Py_ssize_t result;
34765 : PyObject *attr = PyObject_GetAttr(obj, __pyx_n_s_itemsize);
34766 : if (!attr) {
34767 : goto bad;
34768 : }
34769 : result = PyLong_AsSsize_t(attr);
34770 : Py_DECREF(attr);
34771 : return result;
34772 : bad:
34773 : Py_XDECREF(attr);
34774 : return -1;
34775 : }
34776 : #endif
34777 :
34778 : /* memoryview_get_from_buffer */
34779 : #if !CYTHON_COMPILING_IN_LIMITED_API || CYTHON_LIMITED_API >= 0x030b0000
34780 : #else
34781 : static int __Pyx_PyMemoryView_Get_ndim(PyObject *obj) {
34782 : int result;
34783 : PyObject *attr = PyObject_GetAttr(obj, __pyx_n_s_ndim);
34784 : if (!attr) {
34785 : goto bad;
34786 : }
34787 : result = PyLong_AsLong(attr);
34788 : Py_DECREF(attr);
34789 : return result;
34790 : bad:
34791 : Py_XDECREF(attr);
34792 : return -1;
34793 : }
34794 : #endif
34795 :
34796 : /* IterFinish */
34797 0 : static CYTHON_INLINE int __Pyx_IterFinish(void) {
34798 0 : PyObject* exc_type;
34799 0 : __Pyx_PyThreadState_declare
34800 0 : __Pyx_PyThreadState_assign
34801 0 : exc_type = __Pyx_PyErr_CurrentExceptionType();
34802 0 : if (unlikely(exc_type)) {
34803 0 : if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
34804 : return -1;
34805 0 : __Pyx_PyErr_Clear();
34806 0 : return 0;
34807 : }
34808 : return 0;
34809 : }
34810 :
34811 : /* PyObjectCallNoArg */
34812 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
34813 : PyObject *arg[2] = {NULL, NULL};
34814 : return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
34815 : }
34816 :
34817 : /* PyObjectGetMethod */
34818 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
34819 : PyObject *attr;
34820 : #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
34821 : __Pyx_TypeName type_name;
34822 : PyTypeObject *tp = Py_TYPE(obj);
34823 : PyObject *descr;
34824 : descrgetfunc f = NULL;
34825 : PyObject **dictptr, *dict;
34826 : int meth_found = 0;
34827 : assert (*method == NULL);
34828 : if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
34829 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
34830 : goto try_unpack;
34831 : }
34832 : if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
34833 : return 0;
34834 : }
34835 : descr = _PyType_Lookup(tp, name);
34836 : if (likely(descr != NULL)) {
34837 : Py_INCREF(descr);
34838 : #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
34839 : if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
34840 : #elif PY_MAJOR_VERSION >= 3
34841 : #ifdef __Pyx_CyFunction_USED
34842 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
34843 : #else
34844 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
34845 : #endif
34846 : #else
34847 : #ifdef __Pyx_CyFunction_USED
34848 : if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
34849 : #else
34850 : if (likely(PyFunction_Check(descr)))
34851 : #endif
34852 : #endif
34853 : {
34854 : meth_found = 1;
34855 : } else {
34856 : f = Py_TYPE(descr)->tp_descr_get;
34857 : if (f != NULL && PyDescr_IsData(descr)) {
34858 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
34859 : Py_DECREF(descr);
34860 : goto try_unpack;
34861 : }
34862 : }
34863 : }
34864 : dictptr = _PyObject_GetDictPtr(obj);
34865 : if (dictptr != NULL && (dict = *dictptr) != NULL) {
34866 : Py_INCREF(dict);
34867 : attr = __Pyx_PyDict_GetItemStr(dict, name);
34868 : if (attr != NULL) {
34869 : Py_INCREF(attr);
34870 : Py_DECREF(dict);
34871 : Py_XDECREF(descr);
34872 : goto try_unpack;
34873 : }
34874 : Py_DECREF(dict);
34875 : }
34876 : if (meth_found) {
34877 : *method = descr;
34878 : return 1;
34879 : }
34880 : if (f != NULL) {
34881 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
34882 : Py_DECREF(descr);
34883 : goto try_unpack;
34884 : }
34885 : if (likely(descr != NULL)) {
34886 : *method = descr;
34887 : return 0;
34888 : }
34889 : type_name = __Pyx_PyType_GetName(tp);
34890 : PyErr_Format(PyExc_AttributeError,
34891 : #if PY_MAJOR_VERSION >= 3
34892 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
34893 : type_name, name);
34894 : #else
34895 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
34896 : type_name, PyString_AS_STRING(name));
34897 : #endif
34898 : __Pyx_DECREF_TypeName(type_name);
34899 : return 0;
34900 : #else
34901 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
34902 : goto try_unpack;
34903 : #endif
34904 : try_unpack:
34905 : #if CYTHON_UNPACK_METHODS
34906 : if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
34907 : PyObject *function = PyMethod_GET_FUNCTION(attr);
34908 : Py_INCREF(function);
34909 : Py_DECREF(attr);
34910 : *method = function;
34911 : return 1;
34912 : }
34913 : #endif
34914 : *method = attr;
34915 : return 0;
34916 : }
34917 :
34918 : /* PyObjectCallMethod0 */
34919 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
34920 : PyObject *method = NULL, *result = NULL;
34921 : int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
34922 : if (likely(is_method)) {
34923 : result = __Pyx_PyObject_CallOneArg(method, obj);
34924 : Py_DECREF(method);
34925 : return result;
34926 : }
34927 : if (unlikely(!method)) goto bad;
34928 : result = __Pyx_PyObject_CallNoArg(method);
34929 : Py_DECREF(method);
34930 : bad:
34931 : return result;
34932 : }
34933 :
34934 : /* UnpackItemEndCheck */
34935 0 : static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
34936 0 : if (unlikely(retval)) {
34937 0 : Py_DECREF(retval);
34938 0 : __Pyx_RaiseTooManyValuesError(expected);
34939 0 : return -1;
34940 : }
34941 0 : return __Pyx_IterFinish();
34942 : }
34943 :
34944 : /* UnpackTupleError */
34945 0 : static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
34946 0 : if (t == Py_None) {
34947 0 : __Pyx_RaiseNoneNotIterableError();
34948 0 : } else if (PyTuple_GET_SIZE(t) < index) {
34949 0 : __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
34950 : } else {
34951 0 : __Pyx_RaiseTooManyValuesError(index);
34952 : }
34953 0 : }
34954 :
34955 : /* UnpackTuple2 */
34956 0 : static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
34957 : PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
34958 0 : PyObject *value1 = NULL, *value2 = NULL;
34959 : #if CYTHON_COMPILING_IN_PYPY
34960 : value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
34961 : value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
34962 : #else
34963 0 : value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
34964 0 : value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
34965 : #endif
34966 0 : if (decref_tuple) {
34967 0 : Py_DECREF(tuple);
34968 : }
34969 0 : *pvalue1 = value1;
34970 0 : *pvalue2 = value2;
34971 0 : return 0;
34972 : #if CYTHON_COMPILING_IN_PYPY
34973 : bad:
34974 : Py_XDECREF(value1);
34975 : Py_XDECREF(value2);
34976 : if (decref_tuple) { Py_XDECREF(tuple); }
34977 : return -1;
34978 : #endif
34979 : }
34980 0 : static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
34981 : int has_known_size, int decref_tuple) {
34982 0 : Py_ssize_t index;
34983 0 : PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
34984 0 : iternextfunc iternext;
34985 0 : iter = PyObject_GetIter(tuple);
34986 0 : if (unlikely(!iter)) goto bad;
34987 0 : if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
34988 0 : iternext = __Pyx_PyObject_GetIterNextFunc(iter);
34989 0 : value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
34990 0 : value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
34991 0 : if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
34992 0 : Py_DECREF(iter);
34993 0 : *pvalue1 = value1;
34994 0 : *pvalue2 = value2;
34995 0 : return 0;
34996 0 : unpacking_failed:
34997 0 : if (!has_known_size && __Pyx_IterFinish() == 0)
34998 0 : __Pyx_RaiseNeedMoreValuesError(index);
34999 0 : bad:
35000 0 : Py_XDECREF(iter);
35001 0 : Py_XDECREF(value1);
35002 0 : Py_XDECREF(value2);
35003 0 : if (decref_tuple) { Py_XDECREF(tuple); }
35004 : return -1;
35005 : }
35006 :
35007 : /* dict_iter */
35008 : #if CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
35009 : #include <string.h>
35010 : #endif
35011 1 : static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
35012 : Py_ssize_t* p_orig_length, int* p_source_is_dict) {
35013 1 : is_dict = is_dict || likely(PyDict_CheckExact(iterable));
35014 1 : *p_source_is_dict = is_dict;
35015 1 : if (is_dict) {
35016 : #if !CYTHON_COMPILING_IN_PYPY
35017 1 : *p_orig_length = PyDict_Size(iterable);
35018 1 : Py_INCREF(iterable);
35019 1 : return iterable;
35020 : #elif PY_MAJOR_VERSION >= 3
35021 : static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
35022 : PyObject **pp = NULL;
35023 : if (method_name) {
35024 : const char *name = PyUnicode_AsUTF8(method_name);
35025 : if (strcmp(name, "iteritems") == 0) pp = &py_items;
35026 : else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
35027 : else if (strcmp(name, "itervalues") == 0) pp = &py_values;
35028 : if (pp) {
35029 : if (!*pp) {
35030 : *pp = PyUnicode_FromString(name + 4);
35031 : if (!*pp)
35032 : return NULL;
35033 : }
35034 : method_name = *pp;
35035 : }
35036 : }
35037 : #endif
35038 : }
35039 : *p_orig_length = 0;
35040 : if (method_name) {
35041 : PyObject* iter;
35042 : iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
35043 : if (!iterable)
35044 : return NULL;
35045 : #if !CYTHON_COMPILING_IN_PYPY
35046 : if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
35047 : return iterable;
35048 : #endif
35049 : iter = PyObject_GetIter(iterable);
35050 : Py_DECREF(iterable);
35051 : return iter;
35052 : }
35053 : return PyObject_GetIter(iterable);
35054 : }
35055 3 : static CYTHON_INLINE int __Pyx_dict_iter_next(
35056 : PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
35057 : PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
35058 3 : PyObject* next_item;
35059 : #if !CYTHON_COMPILING_IN_PYPY
35060 3 : if (source_is_dict) {
35061 3 : PyObject *key, *value;
35062 3 : if (unlikely(orig_length != PyDict_Size(iter_obj))) {
35063 0 : PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
35064 0 : return -1;
35065 : }
35066 3 : if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
35067 : return 0;
35068 : }
35069 2 : if (pitem) {
35070 0 : PyObject* tuple = PyTuple_New(2);
35071 0 : if (unlikely(!tuple)) {
35072 : return -1;
35073 : }
35074 0 : Py_INCREF(key);
35075 0 : Py_INCREF(value);
35076 0 : PyTuple_SET_ITEM(tuple, 0, key);
35077 0 : PyTuple_SET_ITEM(tuple, 1, value);
35078 0 : *pitem = tuple;
35079 : } else {
35080 2 : if (pkey) {
35081 2 : Py_INCREF(key);
35082 2 : *pkey = key;
35083 : }
35084 2 : if (pvalue) {
35085 0 : Py_INCREF(value);
35086 0 : *pvalue = value;
35087 : }
35088 : }
35089 2 : return 1;
35090 0 : } else if (PyTuple_CheckExact(iter_obj)) {
35091 0 : Py_ssize_t pos = *ppos;
35092 0 : if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
35093 0 : *ppos = pos + 1;
35094 0 : next_item = PyTuple_GET_ITEM(iter_obj, pos);
35095 0 : Py_INCREF(next_item);
35096 0 : } else if (PyList_CheckExact(iter_obj)) {
35097 0 : Py_ssize_t pos = *ppos;
35098 0 : if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
35099 0 : *ppos = pos + 1;
35100 0 : next_item = PyList_GET_ITEM(iter_obj, pos);
35101 0 : Py_INCREF(next_item);
35102 : } else
35103 : #endif
35104 : {
35105 0 : next_item = PyIter_Next(iter_obj);
35106 0 : if (unlikely(!next_item)) {
35107 0 : return __Pyx_IterFinish();
35108 : }
35109 : }
35110 0 : if (pitem) {
35111 0 : *pitem = next_item;
35112 0 : } else if (pkey && pvalue) {
35113 0 : if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
35114 0 : return -1;
35115 0 : } else if (pkey) {
35116 0 : *pkey = next_item;
35117 : } else {
35118 0 : *pvalue = next_item;
35119 : }
35120 : return 1;
35121 : }
35122 :
35123 : /* UnpackUnboundCMethod */
35124 0 : static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
35125 0 : PyObject *result;
35126 0 : PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
35127 0 : if (unlikely(!selfless_args)) return NULL;
35128 0 : result = PyObject_Call(method, selfless_args, kwargs);
35129 0 : Py_DECREF(selfless_args);
35130 : return result;
35131 : }
35132 : static PyMethodDef __Pyx_UnboundCMethod_Def = {
35133 : "CythonUnboundCMethod",
35134 : __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
35135 : METH_VARARGS | METH_KEYWORDS,
35136 : NULL
35137 : };
35138 0 : static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
35139 0 : PyObject *method;
35140 0 : method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
35141 0 : if (unlikely(!method))
35142 : return -1;
35143 0 : target->method = method;
35144 : #if CYTHON_COMPILING_IN_CPYTHON
35145 : #if PY_MAJOR_VERSION >= 3
35146 0 : if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
35147 : #else
35148 : if (likely(!__Pyx_CyOrPyCFunction_Check(method)))
35149 : #endif
35150 : {
35151 0 : PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
35152 0 : target->func = descr->d_method->ml_meth;
35153 0 : target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
35154 : } else
35155 : #endif
35156 : #if CYTHON_COMPILING_IN_PYPY
35157 : #else
35158 0 : if (PyCFunction_Check(method))
35159 : #endif
35160 : {
35161 0 : PyObject *self;
35162 0 : int self_found;
35163 : #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
35164 : self = PyObject_GetAttrString(method, "__self__");
35165 : if (!self) {
35166 : PyErr_Clear();
35167 : }
35168 : #else
35169 0 : self = PyCFunction_GET_SELF(method);
35170 : #endif
35171 0 : self_found = (self && self != Py_None);
35172 : #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
35173 : Py_XDECREF(self);
35174 : #endif
35175 0 : if (self_found) {
35176 0 : PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
35177 0 : if (unlikely(!unbound_method)) return -1;
35178 0 : Py_DECREF(method);
35179 0 : target->method = unbound_method;
35180 : }
35181 : }
35182 : return 0;
35183 : }
35184 :
35185 : /* CallUnboundCMethod0 */
35186 0 : static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
35187 0 : PyObject *args, *result = NULL;
35188 0 : if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
35189 : #if CYTHON_ASSUME_SAFE_MACROS
35190 0 : args = PyTuple_New(1);
35191 0 : if (unlikely(!args)) goto bad;
35192 0 : Py_INCREF(self);
35193 0 : PyTuple_SET_ITEM(args, 0, self);
35194 : #else
35195 : args = PyTuple_Pack(1, self);
35196 : if (unlikely(!args)) goto bad;
35197 : #endif
35198 0 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
35199 0 : Py_DECREF(args);
35200 : bad:
35201 : return result;
35202 : }
35203 :
35204 : /* py_dict_values */
35205 0 : static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
35206 0 : if (PY_MAJOR_VERSION >= 3)
35207 0 : return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_values, d);
35208 : else
35209 : return PyDict_Values(d);
35210 : }
35211 :
35212 : /* CallUnboundCMethod1 */
35213 : #if CYTHON_COMPILING_IN_CPYTHON
35214 : static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
35215 : if (likely(cfunc->func)) {
35216 : int flag = cfunc->flag;
35217 : if (flag == METH_O) {
35218 : return (*(cfunc->func))(self, arg);
35219 : } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) {
35220 : #if PY_VERSION_HEX >= 0x030700A0
35221 : return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
35222 : #else
35223 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
35224 : #endif
35225 : } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) {
35226 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
35227 : }
35228 : }
35229 : return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
35230 : }
35231 : #endif
35232 : static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
35233 : PyObject *args, *result = NULL;
35234 : if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
35235 : #if CYTHON_COMPILING_IN_CPYTHON
35236 : if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
35237 : args = PyTuple_New(1);
35238 : if (unlikely(!args)) goto bad;
35239 : Py_INCREF(arg);
35240 : PyTuple_SET_ITEM(args, 0, arg);
35241 : if (cfunc->flag & METH_KEYWORDS)
35242 : result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
35243 : else
35244 : result = (*cfunc->func)(self, args);
35245 : } else {
35246 : args = PyTuple_New(2);
35247 : if (unlikely(!args)) goto bad;
35248 : Py_INCREF(self);
35249 : PyTuple_SET_ITEM(args, 0, self);
35250 : Py_INCREF(arg);
35251 : PyTuple_SET_ITEM(args, 1, arg);
35252 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
35253 : }
35254 : #else
35255 : args = PyTuple_Pack(2, self, arg);
35256 : if (unlikely(!args)) goto bad;
35257 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
35258 : #endif
35259 : bad:
35260 : Py_XDECREF(args);
35261 : return result;
35262 : }
35263 :
35264 : /* CallUnboundCMethod2 */
35265 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
35266 : static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
35267 : if (likely(cfunc->func)) {
35268 : PyObject *args[2] = {arg1, arg2};
35269 : if (cfunc->flag == METH_FASTCALL) {
35270 : #if PY_VERSION_HEX >= 0x030700A0
35271 : return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
35272 : #else
35273 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
35274 : #endif
35275 : }
35276 : #if PY_VERSION_HEX >= 0x030700A0
35277 : if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
35278 : return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
35279 : #endif
35280 : }
35281 : return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
35282 : }
35283 : #endif
35284 : static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
35285 : PyObject *args, *result = NULL;
35286 : if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
35287 : #if CYTHON_COMPILING_IN_CPYTHON
35288 : if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
35289 : args = PyTuple_New(2);
35290 : if (unlikely(!args)) goto bad;
35291 : Py_INCREF(arg1);
35292 : PyTuple_SET_ITEM(args, 0, arg1);
35293 : Py_INCREF(arg2);
35294 : PyTuple_SET_ITEM(args, 1, arg2);
35295 : if (cfunc->flag & METH_KEYWORDS)
35296 : result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
35297 : else
35298 : result = (*cfunc->func)(self, args);
35299 : } else {
35300 : args = PyTuple_New(3);
35301 : if (unlikely(!args)) goto bad;
35302 : Py_INCREF(self);
35303 : PyTuple_SET_ITEM(args, 0, self);
35304 : Py_INCREF(arg1);
35305 : PyTuple_SET_ITEM(args, 1, arg1);
35306 : Py_INCREF(arg2);
35307 : PyTuple_SET_ITEM(args, 2, arg2);
35308 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
35309 : }
35310 : #else
35311 : args = PyTuple_Pack(3, self, arg1, arg2);
35312 : if (unlikely(!args)) goto bad;
35313 : result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
35314 : #endif
35315 : bad:
35316 : Py_XDECREF(args);
35317 : return result;
35318 : }
35319 :
35320 : /* dict_getitem_default */
35321 55 : static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
35322 55 : PyObject* value;
35323 : #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
35324 55 : value = PyDict_GetItemWithError(d, key);
35325 55 : if (unlikely(!value)) {
35326 0 : if (unlikely(PyErr_Occurred()))
35327 : return NULL;
35328 : value = default_value;
35329 : }
35330 55 : Py_INCREF(value);
35331 : if ((1));
35332 : #else
35333 : if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
35334 : value = PyDict_GetItem(d, key);
35335 : if (unlikely(!value)) {
35336 : value = default_value;
35337 : }
35338 : Py_INCREF(value);
35339 : }
35340 : #endif
35341 : else {
35342 : if (default_value == Py_None)
35343 : value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
35344 : else
35345 : value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
35346 : }
35347 : return value;
35348 : }
35349 :
35350 : /* PyIntBinop */
35351 : #if !CYTHON_COMPILING_IN_PYPY
35352 692 : static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
35353 692 : CYTHON_MAYBE_UNUSED_VAR(intval);
35354 692 : CYTHON_MAYBE_UNUSED_VAR(inplace);
35355 692 : CYTHON_UNUSED_VAR(zerodivision_check);
35356 : #if PY_MAJOR_VERSION < 3
35357 : if (likely(PyInt_CheckExact(op1))) {
35358 : const long b = intval;
35359 : long x;
35360 : long a = PyInt_AS_LONG(op1);
35361 :
35362 : x = (long)((unsigned long)a + (unsigned long)b);
35363 : if (likely((x^a) >= 0 || (x^b) >= 0))
35364 : return PyInt_FromLong(x);
35365 : return PyLong_Type.tp_as_number->nb_add(op1, op2);
35366 : }
35367 : #endif
35368 : #if CYTHON_USE_PYLONG_INTERNALS
35369 692 : if (likely(PyLong_CheckExact(op1))) {
35370 692 : const long b = intval;
35371 692 : long a, x;
35372 : #ifdef HAVE_LONG_LONG
35373 692 : const PY_LONG_LONG llb = intval;
35374 692 : PY_LONG_LONG lla, llx;
35375 : #endif
35376 692 : if (unlikely(__Pyx_PyLong_IsZero(op1))) {
35377 0 : return __Pyx_NewRef(op2);
35378 : }
35379 692 : if (likely(__Pyx_PyLong_IsCompact(op1))) {
35380 692 : a = __Pyx_PyLong_CompactValue(op1);
35381 : } else {
35382 0 : const digit* digits = __Pyx_PyLong_Digits(op1);
35383 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
35384 0 : switch (size) {
35385 0 : case -2:
35386 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
35387 0 : a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35388 0 : break;
35389 : #ifdef HAVE_LONG_LONG
35390 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
35391 : lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35392 : goto long_long;
35393 : #endif
35394 : }
35395 0 : CYTHON_FALLTHROUGH;
35396 0 : case 2:
35397 0 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
35398 0 : a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35399 0 : break;
35400 : #ifdef HAVE_LONG_LONG
35401 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
35402 : lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35403 : goto long_long;
35404 : #endif
35405 : }
35406 : CYTHON_FALLTHROUGH;
35407 : case -3:
35408 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
35409 : a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35410 : break;
35411 : #ifdef HAVE_LONG_LONG
35412 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
35413 : lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35414 : goto long_long;
35415 : #endif
35416 : }
35417 : CYTHON_FALLTHROUGH;
35418 : case 3:
35419 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
35420 : a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35421 : break;
35422 : #ifdef HAVE_LONG_LONG
35423 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
35424 : lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35425 : goto long_long;
35426 : #endif
35427 : }
35428 : CYTHON_FALLTHROUGH;
35429 : case -4:
35430 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
35431 : a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35432 : break;
35433 : #ifdef HAVE_LONG_LONG
35434 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
35435 : lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35436 : goto long_long;
35437 : #endif
35438 : }
35439 : CYTHON_FALLTHROUGH;
35440 : case 4:
35441 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
35442 : a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35443 : break;
35444 : #ifdef HAVE_LONG_LONG
35445 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
35446 : lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35447 : goto long_long;
35448 : #endif
35449 : }
35450 0 : CYTHON_FALLTHROUGH;
35451 0 : default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
35452 : }
35453 : }
35454 692 : x = a + b;
35455 692 : return PyLong_FromLong(x);
35456 : #ifdef HAVE_LONG_LONG
35457 : long_long:
35458 : llx = lla + llb;
35459 : return PyLong_FromLongLong(llx);
35460 : #endif
35461 :
35462 :
35463 : }
35464 : #endif
35465 0 : if (PyFloat_CheckExact(op1)) {
35466 0 : const long b = intval;
35467 : #if CYTHON_COMPILING_IN_LIMITED_API
35468 : double a = __pyx_PyFloat_AsDouble(op1);
35469 : #else
35470 0 : double a = PyFloat_AS_DOUBLE(op1);
35471 : #endif
35472 0 : double result;
35473 :
35474 : PyFPE_START_PROTECT("add", return NULL)
35475 0 : result = ((double)a) + (double)b;
35476 : PyFPE_END_PROTECT(result)
35477 0 : return PyFloat_FromDouble(result);
35478 : }
35479 0 : return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
35480 : }
35481 : #endif
35482 :
35483 : /* PyIntBinop */
35484 : #if !CYTHON_COMPILING_IN_PYPY
35485 346 : static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
35486 346 : CYTHON_MAYBE_UNUSED_VAR(intval);
35487 346 : CYTHON_MAYBE_UNUSED_VAR(inplace);
35488 346 : CYTHON_UNUSED_VAR(zerodivision_check);
35489 : #if PY_MAJOR_VERSION < 3
35490 : if (likely(PyInt_CheckExact(op2))) {
35491 : const long a = intval;
35492 : long b = PyInt_AS_LONG(op2);
35493 :
35494 : #ifdef HAVE_LONG_LONG
35495 : if (sizeof(PY_LONG_LONG) > sizeof(long)) {
35496 : PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b;
35497 : return (result >= LONG_MIN && result <= LONG_MAX) ?
35498 : PyInt_FromLong((long)result) : PyLong_FromLongLong(result);
35499 : }
35500 : #endif
35501 : #if CYTHON_USE_TYPE_SLOTS
35502 : return PyInt_Type.tp_as_number->nb_multiply(op1, op2);
35503 : #else
35504 : return PyNumber_Multiply(op1, op2);
35505 : #endif
35506 : }
35507 : #endif
35508 : #if CYTHON_USE_PYLONG_INTERNALS
35509 346 : if (likely(PyLong_CheckExact(op2))) {
35510 346 : const long a = intval;
35511 346 : long b, x;
35512 : #ifdef HAVE_LONG_LONG
35513 346 : const PY_LONG_LONG lla = intval;
35514 346 : PY_LONG_LONG llb, llx;
35515 : #endif
35516 346 : if (unlikely(__Pyx_PyLong_IsZero(op2))) {
35517 0 : return __Pyx_NewRef(op2);
35518 : }
35519 346 : if (likely(__Pyx_PyLong_IsCompact(op2))) {
35520 346 : b = __Pyx_PyLong_CompactValue(op2);
35521 : } else {
35522 0 : const digit* digits = __Pyx_PyLong_Digits(op2);
35523 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op2);
35524 0 : switch (size) {
35525 : case -2:
35526 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
35527 : b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35528 : break;
35529 : #ifdef HAVE_LONG_LONG
35530 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
35531 : llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35532 : goto long_long;
35533 : #endif
35534 : }
35535 : CYTHON_FALLTHROUGH;
35536 : case 2:
35537 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
35538 : b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35539 : break;
35540 : #ifdef HAVE_LONG_LONG
35541 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
35542 : llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35543 : goto long_long;
35544 : #endif
35545 : }
35546 : CYTHON_FALLTHROUGH;
35547 : case -3:
35548 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
35549 : b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35550 : break;
35551 : #ifdef HAVE_LONG_LONG
35552 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
35553 : llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35554 : goto long_long;
35555 : #endif
35556 : }
35557 : CYTHON_FALLTHROUGH;
35558 : case 3:
35559 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
35560 : b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35561 : break;
35562 : #ifdef HAVE_LONG_LONG
35563 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
35564 : llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35565 : goto long_long;
35566 : #endif
35567 : }
35568 : CYTHON_FALLTHROUGH;
35569 : case -4:
35570 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
35571 : b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35572 : break;
35573 : #ifdef HAVE_LONG_LONG
35574 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
35575 : llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35576 : goto long_long;
35577 : #endif
35578 : }
35579 0 : CYTHON_FALLTHROUGH;
35580 0 : case 4:
35581 0 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
35582 : b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35583 : break;
35584 : #ifdef HAVE_LONG_LONG
35585 0 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
35586 : llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35587 : goto long_long;
35588 : #endif
35589 : }
35590 0 : CYTHON_FALLTHROUGH;
35591 0 : default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
35592 : }
35593 : }
35594 346 : CYTHON_UNUSED_VAR(a);
35595 346 : CYTHON_UNUSED_VAR(b);
35596 : #ifdef HAVE_LONG_LONG
35597 346 : llb = b;
35598 346 : goto long_long;
35599 : #else
35600 : return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
35601 : #endif
35602 : return PyLong_FromLong(x);
35603 : #ifdef HAVE_LONG_LONG
35604 346 : long_long:
35605 346 : llx = lla * llb;
35606 346 : return PyLong_FromLongLong(llx);
35607 : #endif
35608 :
35609 :
35610 : }
35611 : #endif
35612 0 : if (PyFloat_CheckExact(op2)) {
35613 0 : const long a = intval;
35614 : #if CYTHON_COMPILING_IN_LIMITED_API
35615 : double b = __pyx_PyFloat_AsDouble(op2);
35616 : #else
35617 0 : double b = PyFloat_AS_DOUBLE(op2);
35618 : #endif
35619 0 : double result;
35620 :
35621 : PyFPE_START_PROTECT("multiply", return NULL)
35622 0 : result = ((double)a) * (double)b;
35623 : PyFPE_END_PROTECT(result)
35624 0 : return PyFloat_FromDouble(result);
35625 : }
35626 0 : return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
35627 : }
35628 : #endif
35629 :
35630 : /* PyIntBinop */
35631 : #if !CYTHON_COMPILING_IN_PYPY
35632 145 : static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
35633 145 : CYTHON_MAYBE_UNUSED_VAR(intval);
35634 145 : CYTHON_MAYBE_UNUSED_VAR(inplace);
35635 145 : CYTHON_UNUSED_VAR(zerodivision_check);
35636 : #if PY_MAJOR_VERSION < 3
35637 : if (likely(PyInt_CheckExact(op1))) {
35638 : const long b = intval;
35639 : long a = PyInt_AS_LONG(op1);
35640 :
35641 : #ifdef HAVE_LONG_LONG
35642 : if (sizeof(PY_LONG_LONG) > sizeof(long)) {
35643 : PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b;
35644 : return (result >= LONG_MIN && result <= LONG_MAX) ?
35645 : PyInt_FromLong((long)result) : PyLong_FromLongLong(result);
35646 : }
35647 : #endif
35648 : #if CYTHON_USE_TYPE_SLOTS
35649 : return PyInt_Type.tp_as_number->nb_multiply(op1, op2);
35650 : #else
35651 : return PyNumber_Multiply(op1, op2);
35652 : #endif
35653 : }
35654 : #endif
35655 : #if CYTHON_USE_PYLONG_INTERNALS
35656 145 : if (likely(PyLong_CheckExact(op1))) {
35657 0 : const long b = intval;
35658 0 : long a, x;
35659 : #ifdef HAVE_LONG_LONG
35660 0 : const PY_LONG_LONG llb = intval;
35661 0 : PY_LONG_LONG lla, llx;
35662 : #endif
35663 0 : if (unlikely(__Pyx_PyLong_IsZero(op1))) {
35664 0 : return __Pyx_NewRef(op1);
35665 : }
35666 0 : if (likely(__Pyx_PyLong_IsCompact(op1))) {
35667 0 : a = __Pyx_PyLong_CompactValue(op1);
35668 : } else {
35669 0 : const digit* digits = __Pyx_PyLong_Digits(op1);
35670 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1);
35671 0 : switch (size) {
35672 : case -2:
35673 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
35674 : a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35675 : break;
35676 : #ifdef HAVE_LONG_LONG
35677 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
35678 : lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35679 : goto long_long;
35680 : #endif
35681 : }
35682 : CYTHON_FALLTHROUGH;
35683 : case 2:
35684 : if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
35685 : a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35686 : break;
35687 : #ifdef HAVE_LONG_LONG
35688 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
35689 : lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35690 : goto long_long;
35691 : #endif
35692 : }
35693 : CYTHON_FALLTHROUGH;
35694 : case -3:
35695 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
35696 : a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35697 : break;
35698 : #ifdef HAVE_LONG_LONG
35699 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
35700 : lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35701 : goto long_long;
35702 : #endif
35703 : }
35704 : CYTHON_FALLTHROUGH;
35705 : case 3:
35706 : if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
35707 : a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35708 : break;
35709 : #ifdef HAVE_LONG_LONG
35710 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
35711 : lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35712 : goto long_long;
35713 : #endif
35714 : }
35715 : CYTHON_FALLTHROUGH;
35716 : case -4:
35717 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
35718 : a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35719 : break;
35720 : #ifdef HAVE_LONG_LONG
35721 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
35722 : lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35723 : goto long_long;
35724 : #endif
35725 : }
35726 0 : CYTHON_FALLTHROUGH;
35727 0 : case 4:
35728 0 : if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
35729 : a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
35730 : break;
35731 : #ifdef HAVE_LONG_LONG
35732 0 : } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
35733 : lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
35734 : goto long_long;
35735 : #endif
35736 : }
35737 0 : CYTHON_FALLTHROUGH;
35738 0 : default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
35739 : }
35740 : }
35741 0 : CYTHON_UNUSED_VAR(a);
35742 0 : CYTHON_UNUSED_VAR(b);
35743 : #ifdef HAVE_LONG_LONG
35744 0 : lla = a;
35745 0 : goto long_long;
35746 : #else
35747 : return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
35748 : #endif
35749 : return PyLong_FromLong(x);
35750 : #ifdef HAVE_LONG_LONG
35751 0 : long_long:
35752 0 : llx = lla * llb;
35753 0 : return PyLong_FromLongLong(llx);
35754 : #endif
35755 :
35756 :
35757 : }
35758 : #endif
35759 145 : if (PyFloat_CheckExact(op1)) {
35760 0 : const long b = intval;
35761 : #if CYTHON_COMPILING_IN_LIMITED_API
35762 : double a = __pyx_PyFloat_AsDouble(op1);
35763 : #else
35764 0 : double a = PyFloat_AS_DOUBLE(op1);
35765 : #endif
35766 0 : double result;
35767 :
35768 : PyFPE_START_PROTECT("multiply", return NULL)
35769 0 : result = ((double)a) * (double)b;
35770 : PyFPE_END_PROTECT(result)
35771 0 : return PyFloat_FromDouble(result);
35772 : }
35773 290 : return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
35774 : }
35775 : #endif
35776 :
35777 : /* PyObjectFormatAndDecref */
35778 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
35779 0 : if (unlikely(!s)) return NULL;
35780 0 : if (likely(PyUnicode_CheckExact(s))) return s;
35781 : #if PY_MAJOR_VERSION < 3
35782 : if (likely(PyString_CheckExact(s))) {
35783 : PyObject *result = PyUnicode_FromEncodedObject(s, NULL, "strict");
35784 : Py_DECREF(s);
35785 : return result;
35786 : }
35787 : #endif
35788 0 : return __Pyx_PyObject_FormatAndDecref(s, f);
35789 : }
35790 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
35791 0 : PyObject *result;
35792 0 : if (unlikely(!s)) return NULL;
35793 0 : result = PyObject_Format(s, f);
35794 0 : Py_DECREF(s);
35795 : return result;
35796 : }
35797 :
35798 : /* PyObject_GenericGetAttrNoDict */
35799 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
35800 : static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
35801 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
35802 : PyErr_Format(PyExc_AttributeError,
35803 : #if PY_MAJOR_VERSION >= 3
35804 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
35805 : type_name, attr_name);
35806 : #else
35807 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
35808 : type_name, PyString_AS_STRING(attr_name));
35809 : #endif
35810 : __Pyx_DECREF_TypeName(type_name);
35811 : return NULL;
35812 : }
35813 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
35814 : PyObject *descr;
35815 : PyTypeObject *tp = Py_TYPE(obj);
35816 : if (unlikely(!PyString_Check(attr_name))) {
35817 : return PyObject_GenericGetAttr(obj, attr_name);
35818 : }
35819 : assert(!tp->tp_dictoffset);
35820 : descr = _PyType_Lookup(tp, attr_name);
35821 : if (unlikely(!descr)) {
35822 : return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
35823 : }
35824 : Py_INCREF(descr);
35825 : #if PY_MAJOR_VERSION < 3
35826 : if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
35827 : #endif
35828 : {
35829 : descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
35830 : if (unlikely(f)) {
35831 : PyObject *res = f(descr, obj, (PyObject *)tp);
35832 : Py_DECREF(descr);
35833 : return res;
35834 : }
35835 : }
35836 : return descr;
35837 : }
35838 : #endif
35839 :
35840 : /* PyObject_GenericGetAttr */
35841 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
35842 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
35843 : if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
35844 : return PyObject_GenericGetAttr(obj, attr_name);
35845 : }
35846 : return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
35847 : }
35848 : #endif
35849 :
35850 : /* FixUpExtensionType */
35851 : #if CYTHON_USE_TYPE_SPECS
35852 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
35853 : #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
35854 : CYTHON_UNUSED_VAR(spec);
35855 : CYTHON_UNUSED_VAR(type);
35856 : #else
35857 : const PyType_Slot *slot = spec->slots;
35858 : while (slot && slot->slot && slot->slot != Py_tp_members)
35859 : slot++;
35860 : if (slot && slot->slot == Py_tp_members) {
35861 : int changed = 0;
35862 : #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
35863 : const
35864 : #endif
35865 : PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
35866 : while (memb && memb->name) {
35867 : if (memb->name[0] == '_' && memb->name[1] == '_') {
35868 : #if PY_VERSION_HEX < 0x030900b1
35869 : if (strcmp(memb->name, "__weaklistoffset__") == 0) {
35870 : assert(memb->type == T_PYSSIZET);
35871 : assert(memb->flags == READONLY);
35872 : type->tp_weaklistoffset = memb->offset;
35873 : changed = 1;
35874 : }
35875 : else if (strcmp(memb->name, "__dictoffset__") == 0) {
35876 : assert(memb->type == T_PYSSIZET);
35877 : assert(memb->flags == READONLY);
35878 : type->tp_dictoffset = memb->offset;
35879 : changed = 1;
35880 : }
35881 : #if CYTHON_METH_FASTCALL
35882 : else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
35883 : assert(memb->type == T_PYSSIZET);
35884 : assert(memb->flags == READONLY);
35885 : #if PY_VERSION_HEX >= 0x030800b4
35886 : type->tp_vectorcall_offset = memb->offset;
35887 : #else
35888 : type->tp_print = (printfunc) memb->offset;
35889 : #endif
35890 : changed = 1;
35891 : }
35892 : #endif
35893 : #else
35894 : if ((0));
35895 : #endif
35896 : #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
35897 : else if (strcmp(memb->name, "__module__") == 0) {
35898 : PyObject *descr;
35899 : assert(memb->type == T_OBJECT);
35900 : assert(memb->flags == 0 || memb->flags == READONLY);
35901 : descr = PyDescr_NewMember(type, memb);
35902 : if (unlikely(!descr))
35903 : return -1;
35904 : if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
35905 : Py_DECREF(descr);
35906 : return -1;
35907 : }
35908 : Py_DECREF(descr);
35909 : changed = 1;
35910 : }
35911 : #endif
35912 : }
35913 : memb++;
35914 : }
35915 : if (changed)
35916 : PyType_Modified(type);
35917 : }
35918 : #endif
35919 : return 0;
35920 : }
35921 : #endif
35922 :
35923 : /* ValidateBasesTuple */
35924 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
35925 0 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
35926 0 : Py_ssize_t i, n;
35927 : #if CYTHON_ASSUME_SAFE_MACROS
35928 0 : n = PyTuple_GET_SIZE(bases);
35929 : #else
35930 : n = PyTuple_Size(bases);
35931 : if (n < 0) return -1;
35932 : #endif
35933 0 : for (i = 1; i < n; i++)
35934 : {
35935 : #if CYTHON_AVOID_BORROWED_REFS
35936 : PyObject *b0 = PySequence_GetItem(bases, i);
35937 : if (!b0) return -1;
35938 : #elif CYTHON_ASSUME_SAFE_MACROS
35939 0 : PyObject *b0 = PyTuple_GET_ITEM(bases, i);
35940 : #else
35941 : PyObject *b0 = PyTuple_GetItem(bases, i);
35942 : if (!b0) return -1;
35943 : #endif
35944 0 : PyTypeObject *b;
35945 : #if PY_MAJOR_VERSION < 3
35946 : if (PyClass_Check(b0))
35947 : {
35948 : PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
35949 : PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
35950 : #if CYTHON_AVOID_BORROWED_REFS
35951 : Py_DECREF(b0);
35952 : #endif
35953 : return -1;
35954 : }
35955 : #endif
35956 0 : b = (PyTypeObject*) b0;
35957 0 : if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
35958 : {
35959 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
35960 0 : PyErr_Format(PyExc_TypeError,
35961 : "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
35962 0 : __Pyx_DECREF_TypeName(b_name);
35963 : #if CYTHON_AVOID_BORROWED_REFS
35964 : Py_DECREF(b0);
35965 : #endif
35966 0 : return -1;
35967 : }
35968 0 : if (dictoffset == 0)
35969 : {
35970 0 : Py_ssize_t b_dictoffset = 0;
35971 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
35972 0 : b_dictoffset = b->tp_dictoffset;
35973 : #else
35974 : PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
35975 : if (!py_b_dictoffset) goto dictoffset_return;
35976 : b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
35977 : Py_DECREF(py_b_dictoffset);
35978 : if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
35979 : #endif
35980 0 : if (b_dictoffset) {
35981 0 : {
35982 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
35983 0 : PyErr_Format(PyExc_TypeError,
35984 : "extension type '%.200s' has no __dict__ slot, "
35985 : "but base type '" __Pyx_FMT_TYPENAME "' has: "
35986 : "either add 'cdef dict __dict__' to the extension type "
35987 : "or add '__slots__ = [...]' to the base type",
35988 : type_name, b_name);
35989 0 : __Pyx_DECREF_TypeName(b_name);
35990 : }
35991 : #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
35992 : dictoffset_return:
35993 : #endif
35994 : #if CYTHON_AVOID_BORROWED_REFS
35995 : Py_DECREF(b0);
35996 : #endif
35997 0 : return -1;
35998 : }
35999 : }
36000 : #if CYTHON_AVOID_BORROWED_REFS
36001 : Py_DECREF(b0);
36002 : #endif
36003 : }
36004 : return 0;
36005 : }
36006 : #endif
36007 :
36008 : /* PyType_Ready */
36009 12 : static int __Pyx_PyType_Ready(PyTypeObject *t) {
36010 : #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
36011 : (void)__Pyx_PyObject_CallMethod0;
36012 : #if CYTHON_USE_TYPE_SPECS
36013 : (void)__Pyx_validate_bases_tuple;
36014 : #endif
36015 : return PyType_Ready(t);
36016 : #else
36017 12 : int r;
36018 12 : PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
36019 12 : if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
36020 : return -1;
36021 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
36022 12 : {
36023 12 : int gc_was_enabled;
36024 : #if PY_VERSION_HEX >= 0x030A00b1
36025 12 : gc_was_enabled = PyGC_Disable();
36026 12 : (void)__Pyx_PyObject_CallMethod0;
36027 : #else
36028 : PyObject *ret, *py_status;
36029 : PyObject *gc = NULL;
36030 : #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
36031 : gc = PyImport_GetModule(__pyx_kp_u_gc);
36032 : #endif
36033 : if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
36034 : if (unlikely(!gc)) return -1;
36035 : py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
36036 : if (unlikely(!py_status)) {
36037 : Py_DECREF(gc);
36038 : return -1;
36039 : }
36040 : gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
36041 : Py_DECREF(py_status);
36042 : if (gc_was_enabled > 0) {
36043 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
36044 : if (unlikely(!ret)) {
36045 : Py_DECREF(gc);
36046 : return -1;
36047 : }
36048 : Py_DECREF(ret);
36049 : } else if (unlikely(gc_was_enabled == -1)) {
36050 : Py_DECREF(gc);
36051 : return -1;
36052 : }
36053 : #endif
36054 12 : t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
36055 : #if PY_VERSION_HEX >= 0x030A0000
36056 12 : t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
36057 : #endif
36058 : #else
36059 : (void)__Pyx_PyObject_CallMethod0;
36060 : #endif
36061 12 : r = PyType_Ready(t);
36062 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
36063 12 : t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
36064 : #if PY_VERSION_HEX >= 0x030A00b1
36065 12 : if (gc_was_enabled)
36066 12 : PyGC_Enable();
36067 : #else
36068 : if (gc_was_enabled) {
36069 : PyObject *tp, *v, *tb;
36070 : PyErr_Fetch(&tp, &v, &tb);
36071 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
36072 : if (likely(ret || r == -1)) {
36073 : Py_XDECREF(ret);
36074 : PyErr_Restore(tp, v, tb);
36075 : } else {
36076 : Py_XDECREF(tp);
36077 : Py_XDECREF(v);
36078 : Py_XDECREF(tb);
36079 : r = -1;
36080 : }
36081 : }
36082 : Py_DECREF(gc);
36083 : #endif
36084 : }
36085 : #endif
36086 : return r;
36087 : #endif
36088 : }
36089 :
36090 : /* SetVTable */
36091 9 : static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
36092 9 : PyObject *ob = PyCapsule_New(vtable, 0, 0);
36093 9 : if (unlikely(!ob))
36094 0 : goto bad;
36095 : #if CYTHON_COMPILING_IN_LIMITED_API
36096 : if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
36097 : #else
36098 9 : if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
36099 : #endif
36100 0 : goto bad;
36101 9 : Py_DECREF(ob);
36102 : return 0;
36103 0 : bad:
36104 0 : Py_XDECREF(ob);
36105 0 : return -1;
36106 : }
36107 :
36108 : /* GetVTable */
36109 0 : static void* __Pyx_GetVtable(PyTypeObject *type) {
36110 0 : void* ptr;
36111 : #if CYTHON_COMPILING_IN_LIMITED_API
36112 : PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
36113 : #else
36114 0 : PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
36115 : #endif
36116 0 : if (!ob)
36117 0 : goto bad;
36118 0 : ptr = PyCapsule_GetPointer(ob, 0);
36119 0 : if (!ptr && !PyErr_Occurred())
36120 0 : PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
36121 0 : Py_DECREF(ob);
36122 : return ptr;
36123 0 : bad:
36124 0 : Py_XDECREF(ob);
36125 0 : return NULL;
36126 : }
36127 :
36128 : /* MergeVTables */
36129 : #if !CYTHON_COMPILING_IN_LIMITED_API
36130 9 : static int __Pyx_MergeVtables(PyTypeObject *type) {
36131 9 : int i;
36132 9 : void** base_vtables;
36133 9 : __Pyx_TypeName tp_base_name;
36134 9 : __Pyx_TypeName base_name;
36135 9 : void* unknown = (void*)-1;
36136 9 : PyObject* bases = type->tp_bases;
36137 9 : int base_depth = 0;
36138 9 : {
36139 9 : PyTypeObject* base = type->tp_base;
36140 21 : while (base) {
36141 12 : base_depth += 1;
36142 12 : base = base->tp_base;
36143 : }
36144 : }
36145 9 : base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
36146 9 : base_vtables[0] = unknown;
36147 9 : for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
36148 0 : void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
36149 0 : if (base_vtable != NULL) {
36150 0 : int j;
36151 0 : PyTypeObject* base = type->tp_base;
36152 0 : for (j = 0; j < base_depth; j++) {
36153 0 : if (base_vtables[j] == unknown) {
36154 0 : base_vtables[j] = __Pyx_GetVtable(base);
36155 0 : base_vtables[j + 1] = unknown;
36156 : }
36157 0 : if (base_vtables[j] == base_vtable) {
36158 : break;
36159 0 : } else if (base_vtables[j] == NULL) {
36160 0 : goto bad;
36161 : }
36162 0 : base = base->tp_base;
36163 : }
36164 : }
36165 : }
36166 9 : PyErr_Clear();
36167 9 : free(base_vtables);
36168 9 : return 0;
36169 0 : bad:
36170 0 : tp_base_name = __Pyx_PyType_GetName(type->tp_base);
36171 0 : base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
36172 0 : PyErr_Format(PyExc_TypeError,
36173 : "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
36174 0 : __Pyx_DECREF_TypeName(tp_base_name);
36175 0 : __Pyx_DECREF_TypeName(base_name);
36176 0 : free(base_vtables);
36177 0 : return -1;
36178 : }
36179 : #endif
36180 :
36181 : /* SetupReduce */
36182 : #if !CYTHON_COMPILING_IN_LIMITED_API
36183 6 : static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
36184 6 : int ret;
36185 6 : PyObject *name_attr;
36186 6 : name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
36187 6 : if (likely(name_attr)) {
36188 6 : ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
36189 : } else {
36190 : ret = -1;
36191 : }
36192 6 : if (unlikely(ret < 0)) {
36193 0 : PyErr_Clear();
36194 0 : ret = 0;
36195 : }
36196 6 : Py_XDECREF(name_attr);
36197 6 : return ret;
36198 : }
36199 12 : static int __Pyx_setup_reduce(PyObject* type_obj) {
36200 12 : int ret = 0;
36201 12 : PyObject *object_reduce = NULL;
36202 12 : PyObject *object_getstate = NULL;
36203 12 : PyObject *object_reduce_ex = NULL;
36204 12 : PyObject *reduce = NULL;
36205 12 : PyObject *reduce_ex = NULL;
36206 12 : PyObject *reduce_cython = NULL;
36207 12 : PyObject *setstate = NULL;
36208 12 : PyObject *setstate_cython = NULL;
36209 12 : PyObject *getstate = NULL;
36210 : #if CYTHON_USE_PYTYPE_LOOKUP
36211 12 : getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
36212 : #else
36213 : getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
36214 : if (!getstate && PyErr_Occurred()) {
36215 : goto __PYX_BAD;
36216 : }
36217 : #endif
36218 12 : if (getstate) {
36219 : #if CYTHON_USE_PYTYPE_LOOKUP
36220 12 : object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
36221 : #else
36222 : object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
36223 : if (!object_getstate && PyErr_Occurred()) {
36224 : goto __PYX_BAD;
36225 : }
36226 : #endif
36227 12 : if (object_getstate != getstate) {
36228 0 : goto __PYX_GOOD;
36229 : }
36230 : }
36231 : #if CYTHON_USE_PYTYPE_LOOKUP
36232 12 : object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
36233 : #else
36234 : object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
36235 : #endif
36236 12 : reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
36237 12 : if (reduce_ex == object_reduce_ex) {
36238 : #if CYTHON_USE_PYTYPE_LOOKUP
36239 12 : object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
36240 : #else
36241 : object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
36242 : #endif
36243 12 : reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
36244 12 : if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
36245 12 : reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
36246 12 : if (likely(reduce_cython)) {
36247 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
36248 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
36249 0 : } else if (reduce == object_reduce || PyErr_Occurred()) {
36250 0 : goto __PYX_BAD;
36251 : }
36252 12 : setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
36253 12 : if (!setstate) PyErr_Clear();
36254 12 : if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
36255 12 : setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
36256 12 : if (likely(setstate_cython)) {
36257 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
36258 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
36259 0 : } else if (!setstate || PyErr_Occurred()) {
36260 0 : goto __PYX_BAD;
36261 : }
36262 : }
36263 12 : PyType_Modified((PyTypeObject*)type_obj);
36264 : }
36265 : }
36266 12 : goto __PYX_GOOD;
36267 0 : __PYX_BAD:
36268 0 : if (!PyErr_Occurred()) {
36269 0 : __Pyx_TypeName type_obj_name =
36270 : __Pyx_PyType_GetName((PyTypeObject*)type_obj);
36271 0 : PyErr_Format(PyExc_RuntimeError,
36272 : "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
36273 0 : __Pyx_DECREF_TypeName(type_obj_name);
36274 : }
36275 : ret = -1;
36276 12 : __PYX_GOOD:
36277 : #if !CYTHON_USE_PYTYPE_LOOKUP
36278 : Py_XDECREF(object_reduce);
36279 : Py_XDECREF(object_reduce_ex);
36280 : Py_XDECREF(object_getstate);
36281 : Py_XDECREF(getstate);
36282 : #endif
36283 12 : Py_XDECREF(reduce);
36284 12 : Py_XDECREF(reduce_ex);
36285 12 : Py_XDECREF(reduce_cython);
36286 12 : Py_XDECREF(setstate);
36287 12 : Py_XDECREF(setstate_cython);
36288 12 : return ret;
36289 : }
36290 : #endif
36291 :
36292 : /* TypeImport */
36293 : #ifndef __PYX_HAVE_RT_ImportType_3_0_11
36294 : #define __PYX_HAVE_RT_ImportType_3_0_11
36295 48 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
36296 : size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
36297 : {
36298 48 : PyObject *result = 0;
36299 48 : char warning[200];
36300 48 : Py_ssize_t basicsize;
36301 48 : Py_ssize_t itemsize;
36302 : #if CYTHON_COMPILING_IN_LIMITED_API
36303 : PyObject *py_basicsize;
36304 : PyObject *py_itemsize;
36305 : #endif
36306 48 : result = PyObject_GetAttrString(module, class_name);
36307 48 : if (!result)
36308 0 : goto bad;
36309 48 : if (!PyType_Check(result)) {
36310 0 : PyErr_Format(PyExc_TypeError,
36311 : "%.200s.%.200s is not a type object",
36312 : module_name, class_name);
36313 0 : goto bad;
36314 : }
36315 : #if !CYTHON_COMPILING_IN_LIMITED_API
36316 48 : basicsize = ((PyTypeObject *)result)->tp_basicsize;
36317 48 : itemsize = ((PyTypeObject *)result)->tp_itemsize;
36318 : #else
36319 : py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
36320 : if (!py_basicsize)
36321 : goto bad;
36322 : basicsize = PyLong_AsSsize_t(py_basicsize);
36323 : Py_DECREF(py_basicsize);
36324 : py_basicsize = 0;
36325 : if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
36326 : goto bad;
36327 : py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
36328 : if (!py_itemsize)
36329 : goto bad;
36330 : itemsize = PyLong_AsSsize_t(py_itemsize);
36331 : Py_DECREF(py_itemsize);
36332 : py_itemsize = 0;
36333 : if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
36334 : goto bad;
36335 : #endif
36336 48 : if (itemsize) {
36337 3 : if (size % alignment) {
36338 0 : alignment = size % alignment;
36339 : }
36340 3 : if (itemsize < (Py_ssize_t)alignment)
36341 : itemsize = (Py_ssize_t)alignment;
36342 : }
36343 48 : if ((size_t)(basicsize + itemsize) < size) {
36344 0 : PyErr_Format(PyExc_ValueError,
36345 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
36346 : "Expected %zd from C header, got %zd from PyObject",
36347 : module_name, class_name, size, basicsize+itemsize);
36348 0 : goto bad;
36349 : }
36350 48 : if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
36351 0 : ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
36352 0 : PyErr_Format(PyExc_ValueError,
36353 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
36354 : "Expected %zd from C header, got %zd-%zd from PyObject",
36355 : module_name, class_name, size, basicsize, basicsize+itemsize);
36356 0 : goto bad;
36357 : }
36358 48 : else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
36359 0 : PyOS_snprintf(warning, sizeof(warning),
36360 : "%s.%s size changed, may indicate binary incompatibility. "
36361 : "Expected %zd from C header, got %zd from PyObject",
36362 : module_name, class_name, size, basicsize);
36363 0 : if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
36364 : }
36365 : return (PyTypeObject *)result;
36366 0 : bad:
36367 0 : Py_XDECREF(result);
36368 : return NULL;
36369 : }
36370 : #endif
36371 :
36372 : /* FetchSharedCythonModule */
36373 6 : static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
36374 6 : return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
36375 : }
36376 :
36377 : /* FetchCommonType */
36378 6 : static int __Pyx_VerifyCachedType(PyObject *cached_type,
36379 : const char *name,
36380 : Py_ssize_t basicsize,
36381 : Py_ssize_t expected_basicsize) {
36382 6 : if (!PyType_Check(cached_type)) {
36383 0 : PyErr_Format(PyExc_TypeError,
36384 : "Shared Cython type %.200s is not a type object", name);
36385 0 : return -1;
36386 : }
36387 6 : if (basicsize != expected_basicsize) {
36388 0 : PyErr_Format(PyExc_TypeError,
36389 : "Shared Cython type %.200s has the wrong size, try recompiling",
36390 : name);
36391 0 : return -1;
36392 : }
36393 : return 0;
36394 : }
36395 : #if !CYTHON_USE_TYPE_SPECS
36396 6 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
36397 6 : PyObject* abi_module;
36398 6 : const char* object_name;
36399 6 : PyTypeObject *cached_type = NULL;
36400 6 : abi_module = __Pyx_FetchSharedCythonABIModule();
36401 6 : if (!abi_module) return NULL;
36402 6 : object_name = strrchr(type->tp_name, '.');
36403 6 : object_name = object_name ? object_name+1 : type->tp_name;
36404 6 : cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
36405 6 : if (cached_type) {
36406 6 : if (__Pyx_VerifyCachedType(
36407 : (PyObject *)cached_type,
36408 : object_name,
36409 : cached_type->tp_basicsize,
36410 : type->tp_basicsize) < 0) {
36411 0 : goto bad;
36412 : }
36413 6 : goto done;
36414 : }
36415 0 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
36416 0 : PyErr_Clear();
36417 0 : if (PyType_Ready(type) < 0) goto bad;
36418 0 : if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
36419 0 : goto bad;
36420 0 : Py_INCREF(type);
36421 : cached_type = type;
36422 6 : done:
36423 6 : Py_DECREF(abi_module);
36424 : return cached_type;
36425 0 : bad:
36426 0 : Py_XDECREF(cached_type);
36427 0 : cached_type = NULL;
36428 0 : goto done;
36429 : }
36430 : #else
36431 : static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
36432 : PyObject *abi_module, *cached_type = NULL;
36433 : const char* object_name = strrchr(spec->name, '.');
36434 : object_name = object_name ? object_name+1 : spec->name;
36435 : abi_module = __Pyx_FetchSharedCythonABIModule();
36436 : if (!abi_module) return NULL;
36437 : cached_type = PyObject_GetAttrString(abi_module, object_name);
36438 : if (cached_type) {
36439 : Py_ssize_t basicsize;
36440 : #if CYTHON_COMPILING_IN_LIMITED_API
36441 : PyObject *py_basicsize;
36442 : py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
36443 : if (unlikely(!py_basicsize)) goto bad;
36444 : basicsize = PyLong_AsSsize_t(py_basicsize);
36445 : Py_DECREF(py_basicsize);
36446 : py_basicsize = 0;
36447 : if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
36448 : #else
36449 : basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
36450 : #endif
36451 : if (__Pyx_VerifyCachedType(
36452 : cached_type,
36453 : object_name,
36454 : basicsize,
36455 : spec->basicsize) < 0) {
36456 : goto bad;
36457 : }
36458 : goto done;
36459 : }
36460 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
36461 : PyErr_Clear();
36462 : CYTHON_UNUSED_VAR(module);
36463 : cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
36464 : if (unlikely(!cached_type)) goto bad;
36465 : if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
36466 : if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
36467 : done:
36468 : Py_DECREF(abi_module);
36469 : assert(cached_type == NULL || PyType_Check(cached_type));
36470 : return (PyTypeObject *) cached_type;
36471 : bad:
36472 : Py_XDECREF(cached_type);
36473 : cached_type = NULL;
36474 : goto done;
36475 : }
36476 : #endif
36477 :
36478 : /* PyVectorcallFastCallDict */
36479 : #if CYTHON_METH_FASTCALL
36480 0 : static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
36481 : {
36482 0 : PyObject *res = NULL;
36483 0 : PyObject *kwnames;
36484 0 : PyObject **newargs;
36485 0 : PyObject **kwvalues;
36486 0 : Py_ssize_t i, pos;
36487 0 : size_t j;
36488 0 : PyObject *key, *value;
36489 0 : unsigned long keys_are_strings;
36490 0 : Py_ssize_t nkw = PyDict_GET_SIZE(kw);
36491 0 : newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
36492 0 : if (unlikely(newargs == NULL)) {
36493 0 : PyErr_NoMemory();
36494 0 : return NULL;
36495 : }
36496 0 : for (j = 0; j < nargs; j++) newargs[j] = args[j];
36497 0 : kwnames = PyTuple_New(nkw);
36498 0 : if (unlikely(kwnames == NULL)) {
36499 0 : PyMem_Free(newargs);
36500 0 : return NULL;
36501 : }
36502 0 : kwvalues = newargs + nargs;
36503 0 : pos = i = 0;
36504 0 : keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
36505 0 : while (PyDict_Next(kw, &pos, &key, &value)) {
36506 0 : keys_are_strings &= Py_TYPE(key)->tp_flags;
36507 0 : Py_INCREF(key);
36508 0 : Py_INCREF(value);
36509 0 : PyTuple_SET_ITEM(kwnames, i, key);
36510 0 : kwvalues[i] = value;
36511 0 : i++;
36512 : }
36513 0 : if (unlikely(!keys_are_strings)) {
36514 0 : PyErr_SetString(PyExc_TypeError, "keywords must be strings");
36515 0 : goto cleanup;
36516 : }
36517 0 : res = vc(func, newargs, nargs, kwnames);
36518 0 : cleanup:
36519 0 : Py_DECREF(kwnames);
36520 0 : for (i = 0; i < nkw; i++)
36521 0 : Py_DECREF(kwvalues[i]);
36522 0 : PyMem_Free(newargs);
36523 : return res;
36524 : }
36525 0 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
36526 : {
36527 0 : if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
36528 0 : return vc(func, args, nargs, NULL);
36529 : }
36530 0 : return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
36531 : }
36532 : #endif
36533 :
36534 : /* CythonFunctionShared */
36535 : #if CYTHON_COMPILING_IN_LIMITED_API
36536 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
36537 : if (__Pyx_CyFunction_Check(func)) {
36538 : return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
36539 : } else if (PyCFunction_Check(func)) {
36540 : return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
36541 : }
36542 : return 0;
36543 : }
36544 : #else
36545 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
36546 : return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
36547 : }
36548 : #endif
36549 0 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
36550 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
36551 : __Pyx_Py_XDECREF_SET(
36552 : __Pyx_CyFunction_GetClassObj(f),
36553 : ((classobj) ? __Pyx_NewRef(classobj) : NULL));
36554 : #else
36555 0 : __Pyx_Py_XDECREF_SET(
36556 : ((PyCMethodObject *) (f))->mm_class,
36557 : (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
36558 : #endif
36559 0 : }
36560 : static PyObject *
36561 0 : __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
36562 : {
36563 0 : CYTHON_UNUSED_VAR(closure);
36564 0 : if (unlikely(op->func_doc == NULL)) {
36565 : #if CYTHON_COMPILING_IN_LIMITED_API
36566 : op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
36567 : if (unlikely(!op->func_doc)) return NULL;
36568 : #else
36569 0 : if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
36570 : #if PY_MAJOR_VERSION >= 3
36571 0 : op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
36572 : #else
36573 : op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
36574 : #endif
36575 0 : if (unlikely(op->func_doc == NULL))
36576 : return NULL;
36577 : } else {
36578 0 : Py_INCREF(Py_None);
36579 0 : return Py_None;
36580 : }
36581 : #endif
36582 : }
36583 0 : Py_INCREF(op->func_doc);
36584 : return op->func_doc;
36585 : }
36586 : static int
36587 0 : __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
36588 : {
36589 0 : CYTHON_UNUSED_VAR(context);
36590 0 : if (value == NULL) {
36591 0 : value = Py_None;
36592 : }
36593 0 : Py_INCREF(value);
36594 0 : __Pyx_Py_XDECREF_SET(op->func_doc, value);
36595 0 : return 0;
36596 : }
36597 : static PyObject *
36598 0 : __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
36599 : {
36600 0 : CYTHON_UNUSED_VAR(context);
36601 0 : if (unlikely(op->func_name == NULL)) {
36602 : #if CYTHON_COMPILING_IN_LIMITED_API
36603 : op->func_name = PyObject_GetAttrString(op->func, "__name__");
36604 : #elif PY_MAJOR_VERSION >= 3
36605 0 : op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
36606 : #else
36607 : op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
36608 : #endif
36609 0 : if (unlikely(op->func_name == NULL))
36610 : return NULL;
36611 : }
36612 0 : Py_INCREF(op->func_name);
36613 : return op->func_name;
36614 : }
36615 : static int
36616 0 : __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
36617 : {
36618 0 : CYTHON_UNUSED_VAR(context);
36619 : #if PY_MAJOR_VERSION >= 3
36620 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
36621 : #else
36622 : if (unlikely(value == NULL || !PyString_Check(value)))
36623 : #endif
36624 : {
36625 0 : PyErr_SetString(PyExc_TypeError,
36626 : "__name__ must be set to a string object");
36627 0 : return -1;
36628 : }
36629 0 : Py_INCREF(value);
36630 0 : __Pyx_Py_XDECREF_SET(op->func_name, value);
36631 0 : return 0;
36632 : }
36633 : static PyObject *
36634 0 : __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
36635 : {
36636 0 : CYTHON_UNUSED_VAR(context);
36637 0 : Py_INCREF(op->func_qualname);
36638 0 : return op->func_qualname;
36639 : }
36640 : static int
36641 0 : __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
36642 : {
36643 0 : CYTHON_UNUSED_VAR(context);
36644 : #if PY_MAJOR_VERSION >= 3
36645 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
36646 : #else
36647 : if (unlikely(value == NULL || !PyString_Check(value)))
36648 : #endif
36649 : {
36650 0 : PyErr_SetString(PyExc_TypeError,
36651 : "__qualname__ must be set to a string object");
36652 0 : return -1;
36653 : }
36654 0 : Py_INCREF(value);
36655 0 : __Pyx_Py_XDECREF_SET(op->func_qualname, value);
36656 0 : return 0;
36657 : }
36658 : static PyObject *
36659 0 : __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
36660 : {
36661 0 : CYTHON_UNUSED_VAR(context);
36662 0 : if (unlikely(op->func_dict == NULL)) {
36663 0 : op->func_dict = PyDict_New();
36664 0 : if (unlikely(op->func_dict == NULL))
36665 : return NULL;
36666 : }
36667 0 : Py_INCREF(op->func_dict);
36668 : return op->func_dict;
36669 : }
36670 : static int
36671 0 : __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
36672 : {
36673 0 : CYTHON_UNUSED_VAR(context);
36674 0 : if (unlikely(value == NULL)) {
36675 0 : PyErr_SetString(PyExc_TypeError,
36676 : "function's dictionary may not be deleted");
36677 0 : return -1;
36678 : }
36679 0 : if (unlikely(!PyDict_Check(value))) {
36680 0 : PyErr_SetString(PyExc_TypeError,
36681 : "setting function's dictionary to a non-dict");
36682 0 : return -1;
36683 : }
36684 0 : Py_INCREF(value);
36685 0 : __Pyx_Py_XDECREF_SET(op->func_dict, value);
36686 0 : return 0;
36687 : }
36688 : static PyObject *
36689 0 : __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
36690 : {
36691 0 : CYTHON_UNUSED_VAR(context);
36692 0 : Py_INCREF(op->func_globals);
36693 0 : return op->func_globals;
36694 : }
36695 : static PyObject *
36696 0 : __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
36697 : {
36698 0 : CYTHON_UNUSED_VAR(op);
36699 0 : CYTHON_UNUSED_VAR(context);
36700 0 : Py_INCREF(Py_None);
36701 0 : return Py_None;
36702 : }
36703 : static PyObject *
36704 0 : __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
36705 : {
36706 0 : PyObject* result = (op->func_code) ? op->func_code : Py_None;
36707 0 : CYTHON_UNUSED_VAR(context);
36708 0 : Py_INCREF(result);
36709 0 : return result;
36710 : }
36711 : static int
36712 0 : __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
36713 0 : int result = 0;
36714 0 : PyObject *res = op->defaults_getter((PyObject *) op);
36715 0 : if (unlikely(!res))
36716 : return -1;
36717 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36718 0 : op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
36719 0 : Py_INCREF(op->defaults_tuple);
36720 0 : op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
36721 0 : Py_INCREF(op->defaults_kwdict);
36722 : #else
36723 : op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
36724 : if (unlikely(!op->defaults_tuple)) result = -1;
36725 : else {
36726 : op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
36727 : if (unlikely(!op->defaults_kwdict)) result = -1;
36728 : }
36729 : #endif
36730 0 : Py_DECREF(res);
36731 : return result;
36732 : }
36733 : static int
36734 0 : __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
36735 0 : CYTHON_UNUSED_VAR(context);
36736 0 : if (!value) {
36737 : value = Py_None;
36738 0 : } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
36739 0 : PyErr_SetString(PyExc_TypeError,
36740 : "__defaults__ must be set to a tuple object");
36741 0 : return -1;
36742 : }
36743 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
36744 : "currently affect the values used in function calls", 1);
36745 0 : Py_INCREF(value);
36746 0 : __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
36747 0 : return 0;
36748 : }
36749 : static PyObject *
36750 0 : __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
36751 0 : PyObject* result = op->defaults_tuple;
36752 0 : CYTHON_UNUSED_VAR(context);
36753 0 : if (unlikely(!result)) {
36754 0 : if (op->defaults_getter) {
36755 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
36756 0 : result = op->defaults_tuple;
36757 : } else {
36758 : result = Py_None;
36759 : }
36760 : }
36761 0 : Py_INCREF(result);
36762 : return result;
36763 : }
36764 : static int
36765 0 : __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
36766 0 : CYTHON_UNUSED_VAR(context);
36767 0 : if (!value) {
36768 : value = Py_None;
36769 0 : } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
36770 0 : PyErr_SetString(PyExc_TypeError,
36771 : "__kwdefaults__ must be set to a dict object");
36772 0 : return -1;
36773 : }
36774 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
36775 : "currently affect the values used in function calls", 1);
36776 0 : Py_INCREF(value);
36777 0 : __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
36778 0 : return 0;
36779 : }
36780 : static PyObject *
36781 0 : __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
36782 0 : PyObject* result = op->defaults_kwdict;
36783 0 : CYTHON_UNUSED_VAR(context);
36784 0 : if (unlikely(!result)) {
36785 0 : if (op->defaults_getter) {
36786 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
36787 0 : result = op->defaults_kwdict;
36788 : } else {
36789 : result = Py_None;
36790 : }
36791 : }
36792 0 : Py_INCREF(result);
36793 : return result;
36794 : }
36795 : static int
36796 0 : __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
36797 0 : CYTHON_UNUSED_VAR(context);
36798 0 : if (!value || value == Py_None) {
36799 : value = NULL;
36800 0 : } else if (unlikely(!PyDict_Check(value))) {
36801 0 : PyErr_SetString(PyExc_TypeError,
36802 : "__annotations__ must be set to a dict object");
36803 0 : return -1;
36804 : }
36805 0 : Py_XINCREF(value);
36806 0 : __Pyx_Py_XDECREF_SET(op->func_annotations, value);
36807 0 : return 0;
36808 : }
36809 : static PyObject *
36810 0 : __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
36811 0 : PyObject* result = op->func_annotations;
36812 0 : CYTHON_UNUSED_VAR(context);
36813 0 : if (unlikely(!result)) {
36814 0 : result = PyDict_New();
36815 0 : if (unlikely(!result)) return NULL;
36816 0 : op->func_annotations = result;
36817 : }
36818 0 : Py_INCREF(result);
36819 : return result;
36820 : }
36821 : static PyObject *
36822 0 : __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
36823 0 : int is_coroutine;
36824 0 : CYTHON_UNUSED_VAR(context);
36825 0 : if (op->func_is_coroutine) {
36826 0 : return __Pyx_NewRef(op->func_is_coroutine);
36827 : }
36828 0 : is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
36829 : #if PY_VERSION_HEX >= 0x03050000
36830 0 : if (is_coroutine) {
36831 0 : PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
36832 0 : fromlist = PyList_New(1);
36833 0 : if (unlikely(!fromlist)) return NULL;
36834 0 : Py_INCREF(marker);
36835 : #if CYTHON_ASSUME_SAFE_MACROS
36836 0 : PyList_SET_ITEM(fromlist, 0, marker);
36837 : #else
36838 : if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
36839 : Py_DECREF(marker);
36840 : Py_DECREF(fromlist);
36841 : return NULL;
36842 : }
36843 : #endif
36844 0 : module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
36845 0 : Py_DECREF(fromlist);
36846 0 : if (unlikely(!module)) goto ignore;
36847 0 : op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
36848 0 : Py_DECREF(module);
36849 0 : if (likely(op->func_is_coroutine)) {
36850 0 : return __Pyx_NewRef(op->func_is_coroutine);
36851 : }
36852 0 : ignore:
36853 0 : PyErr_Clear();
36854 : }
36855 : #endif
36856 0 : op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
36857 0 : return __Pyx_NewRef(op->func_is_coroutine);
36858 : }
36859 : #if CYTHON_COMPILING_IN_LIMITED_API
36860 : static PyObject *
36861 : __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
36862 : CYTHON_UNUSED_VAR(context);
36863 : return PyObject_GetAttrString(op->func, "__module__");
36864 : }
36865 : static int
36866 : __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
36867 : CYTHON_UNUSED_VAR(context);
36868 : return PyObject_SetAttrString(op->func, "__module__", value);
36869 : }
36870 : #endif
36871 : static PyGetSetDef __pyx_CyFunction_getsets[] = {
36872 : {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
36873 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
36874 : {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
36875 : {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
36876 : {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
36877 : {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
36878 : {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
36879 : {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
36880 : {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
36881 : {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
36882 : {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
36883 : {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
36884 : {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
36885 : {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
36886 : {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
36887 : {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
36888 : {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
36889 : {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
36890 : #if CYTHON_COMPILING_IN_LIMITED_API
36891 : {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
36892 : #endif
36893 : {0, 0, 0, 0, 0}
36894 : };
36895 : static PyMemberDef __pyx_CyFunction_members[] = {
36896 : #if !CYTHON_COMPILING_IN_LIMITED_API
36897 : {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
36898 : #endif
36899 : #if CYTHON_USE_TYPE_SPECS
36900 : {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
36901 : #if CYTHON_METH_FASTCALL
36902 : #if CYTHON_BACKPORT_VECTORCALL
36903 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
36904 : #else
36905 : #if !CYTHON_COMPILING_IN_LIMITED_API
36906 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
36907 : #endif
36908 : #endif
36909 : #endif
36910 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
36911 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
36912 : #else
36913 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
36914 : #endif
36915 : #endif
36916 : {0, 0, 0, 0, 0}
36917 : };
36918 : static PyObject *
36919 0 : __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
36920 : {
36921 0 : CYTHON_UNUSED_VAR(args);
36922 : #if PY_MAJOR_VERSION >= 3
36923 0 : Py_INCREF(m->func_qualname);
36924 0 : return m->func_qualname;
36925 : #else
36926 : return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
36927 : #endif
36928 : }
36929 : static PyMethodDef __pyx_CyFunction_methods[] = {
36930 : {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
36931 : {0, 0, 0, 0}
36932 : };
36933 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
36934 : #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
36935 : #else
36936 : #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
36937 : #endif
36938 42 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
36939 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
36940 : #if !CYTHON_COMPILING_IN_LIMITED_API
36941 42 : PyCFunctionObject *cf = (PyCFunctionObject*) op;
36942 : #endif
36943 42 : if (unlikely(op == NULL))
36944 : return NULL;
36945 : #if CYTHON_COMPILING_IN_LIMITED_API
36946 : op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
36947 : if (unlikely(!op->func)) return NULL;
36948 : #endif
36949 42 : op->flags = flags;
36950 42 : __Pyx_CyFunction_weakreflist(op) = NULL;
36951 : #if !CYTHON_COMPILING_IN_LIMITED_API
36952 42 : cf->m_ml = ml;
36953 42 : cf->m_self = (PyObject *) op;
36954 : #endif
36955 42 : Py_XINCREF(closure);
36956 42 : op->func_closure = closure;
36957 : #if !CYTHON_COMPILING_IN_LIMITED_API
36958 42 : Py_XINCREF(module);
36959 42 : cf->m_module = module;
36960 : #endif
36961 42 : op->func_dict = NULL;
36962 42 : op->func_name = NULL;
36963 42 : Py_INCREF(qualname);
36964 42 : op->func_qualname = qualname;
36965 42 : op->func_doc = NULL;
36966 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
36967 : op->func_classobj = NULL;
36968 : #else
36969 42 : ((PyCMethodObject*)op)->mm_class = NULL;
36970 : #endif
36971 42 : op->func_globals = globals;
36972 42 : Py_INCREF(op->func_globals);
36973 42 : Py_XINCREF(code);
36974 42 : op->func_code = code;
36975 42 : op->defaults_pyobjects = 0;
36976 42 : op->defaults_size = 0;
36977 42 : op->defaults = NULL;
36978 42 : op->defaults_tuple = NULL;
36979 42 : op->defaults_kwdict = NULL;
36980 42 : op->defaults_getter = NULL;
36981 42 : op->func_annotations = NULL;
36982 42 : op->func_is_coroutine = NULL;
36983 : #if CYTHON_METH_FASTCALL
36984 42 : switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
36985 0 : case METH_NOARGS:
36986 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
36987 0 : break;
36988 0 : case METH_O:
36989 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
36990 0 : break;
36991 0 : case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
36992 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
36993 0 : break;
36994 33 : case METH_FASTCALL | METH_KEYWORDS:
36995 33 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
36996 33 : break;
36997 9 : case METH_VARARGS | METH_KEYWORDS:
36998 9 : __Pyx_CyFunction_func_vectorcall(op) = NULL;
36999 9 : break;
37000 0 : default:
37001 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
37002 0 : Py_DECREF(op);
37003 : return NULL;
37004 : }
37005 : #endif
37006 : return (PyObject *) op;
37007 : }
37008 : static int
37009 0 : __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
37010 : {
37011 0 : Py_CLEAR(m->func_closure);
37012 : #if CYTHON_COMPILING_IN_LIMITED_API
37013 : Py_CLEAR(m->func);
37014 : #else
37015 0 : Py_CLEAR(((PyCFunctionObject*)m)->m_module);
37016 : #endif
37017 0 : Py_CLEAR(m->func_dict);
37018 0 : Py_CLEAR(m->func_name);
37019 0 : Py_CLEAR(m->func_qualname);
37020 0 : Py_CLEAR(m->func_doc);
37021 0 : Py_CLEAR(m->func_globals);
37022 0 : Py_CLEAR(m->func_code);
37023 : #if !CYTHON_COMPILING_IN_LIMITED_API
37024 : #if PY_VERSION_HEX < 0x030900B1
37025 : Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
37026 : #else
37027 0 : {
37028 0 : PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
37029 0 : ((PyCMethodObject *) (m))->mm_class = NULL;
37030 0 : Py_XDECREF(cls);
37031 : }
37032 : #endif
37033 : #endif
37034 0 : Py_CLEAR(m->defaults_tuple);
37035 0 : Py_CLEAR(m->defaults_kwdict);
37036 0 : Py_CLEAR(m->func_annotations);
37037 0 : Py_CLEAR(m->func_is_coroutine);
37038 0 : if (m->defaults) {
37039 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
37040 : int i;
37041 0 : for (i = 0; i < m->defaults_pyobjects; i++)
37042 0 : Py_XDECREF(pydefaults[i]);
37043 0 : PyObject_Free(m->defaults);
37044 0 : m->defaults = NULL;
37045 : }
37046 0 : return 0;
37047 : }
37048 0 : static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
37049 : {
37050 0 : if (__Pyx_CyFunction_weakreflist(m) != NULL)
37051 0 : PyObject_ClearWeakRefs((PyObject *) m);
37052 0 : __Pyx_CyFunction_clear(m);
37053 0 : __Pyx_PyHeapTypeObject_GC_Del(m);
37054 0 : }
37055 0 : static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
37056 : {
37057 0 : PyObject_GC_UnTrack(m);
37058 0 : __Pyx__CyFunction_dealloc(m);
37059 0 : }
37060 0 : static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
37061 : {
37062 0 : Py_VISIT(m->func_closure);
37063 : #if CYTHON_COMPILING_IN_LIMITED_API
37064 : Py_VISIT(m->func);
37065 : #else
37066 0 : Py_VISIT(((PyCFunctionObject*)m)->m_module);
37067 : #endif
37068 0 : Py_VISIT(m->func_dict);
37069 0 : Py_VISIT(m->func_name);
37070 0 : Py_VISIT(m->func_qualname);
37071 0 : Py_VISIT(m->func_doc);
37072 0 : Py_VISIT(m->func_globals);
37073 0 : Py_VISIT(m->func_code);
37074 : #if !CYTHON_COMPILING_IN_LIMITED_API
37075 0 : Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
37076 : #endif
37077 0 : Py_VISIT(m->defaults_tuple);
37078 0 : Py_VISIT(m->defaults_kwdict);
37079 0 : Py_VISIT(m->func_is_coroutine);
37080 0 : if (m->defaults) {
37081 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
37082 : int i;
37083 0 : for (i = 0; i < m->defaults_pyobjects; i++)
37084 0 : Py_VISIT(pydefaults[i]);
37085 : }
37086 : return 0;
37087 : }
37088 : static PyObject*
37089 0 : __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
37090 : {
37091 : #if PY_MAJOR_VERSION >= 3
37092 0 : return PyUnicode_FromFormat("<cyfunction %U at %p>",
37093 0 : op->func_qualname, (void *)op);
37094 : #else
37095 : return PyString_FromFormat("<cyfunction %s at %p>",
37096 : PyString_AsString(op->func_qualname), (void *)op);
37097 : #endif
37098 : }
37099 0 : static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
37100 : #if CYTHON_COMPILING_IN_LIMITED_API
37101 : PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
37102 : PyObject *py_name = NULL;
37103 : PyCFunction meth;
37104 : int flags;
37105 : meth = PyCFunction_GetFunction(f);
37106 : if (unlikely(!meth)) return NULL;
37107 : flags = PyCFunction_GetFlags(f);
37108 : if (unlikely(flags < 0)) return NULL;
37109 : #else
37110 0 : PyCFunctionObject* f = (PyCFunctionObject*)func;
37111 0 : PyCFunction meth = f->m_ml->ml_meth;
37112 0 : int flags = f->m_ml->ml_flags;
37113 : #endif
37114 0 : Py_ssize_t size;
37115 0 : switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
37116 0 : case METH_VARARGS:
37117 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0))
37118 0 : return (*meth)(self, arg);
37119 : break;
37120 0 : case METH_VARARGS | METH_KEYWORDS:
37121 0 : return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
37122 0 : case METH_NOARGS:
37123 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
37124 : #if CYTHON_ASSUME_SAFE_MACROS
37125 0 : size = PyTuple_GET_SIZE(arg);
37126 : #else
37127 : size = PyTuple_Size(arg);
37128 : if (unlikely(size < 0)) return NULL;
37129 : #endif
37130 0 : if (likely(size == 0))
37131 0 : return (*meth)(self, NULL);
37132 : #if CYTHON_COMPILING_IN_LIMITED_API
37133 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
37134 : if (!py_name) return NULL;
37135 : PyErr_Format(PyExc_TypeError,
37136 : "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
37137 : py_name, size);
37138 : Py_DECREF(py_name);
37139 : #else
37140 0 : PyErr_Format(PyExc_TypeError,
37141 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
37142 0 : f->m_ml->ml_name, size);
37143 : #endif
37144 0 : return NULL;
37145 : }
37146 : break;
37147 0 : case METH_O:
37148 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
37149 : #if CYTHON_ASSUME_SAFE_MACROS
37150 0 : size = PyTuple_GET_SIZE(arg);
37151 : #else
37152 : size = PyTuple_Size(arg);
37153 : if (unlikely(size < 0)) return NULL;
37154 : #endif
37155 0 : if (likely(size == 1)) {
37156 0 : PyObject *result, *arg0;
37157 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37158 0 : arg0 = PyTuple_GET_ITEM(arg, 0);
37159 : #else
37160 : arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
37161 : #endif
37162 0 : result = (*meth)(self, arg0);
37163 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
37164 : Py_DECREF(arg0);
37165 : #endif
37166 0 : return result;
37167 : }
37168 : #if CYTHON_COMPILING_IN_LIMITED_API
37169 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
37170 : if (!py_name) return NULL;
37171 : PyErr_Format(PyExc_TypeError,
37172 : "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
37173 : py_name, size);
37174 : Py_DECREF(py_name);
37175 : #else
37176 0 : PyErr_Format(PyExc_TypeError,
37177 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
37178 0 : f->m_ml->ml_name, size);
37179 : #endif
37180 0 : return NULL;
37181 : }
37182 : break;
37183 0 : default:
37184 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
37185 0 : return NULL;
37186 : }
37187 : #if CYTHON_COMPILING_IN_LIMITED_API
37188 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
37189 : if (!py_name) return NULL;
37190 : PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
37191 : py_name);
37192 : Py_DECREF(py_name);
37193 : #else
37194 0 : PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
37195 0 : f->m_ml->ml_name);
37196 : #endif
37197 0 : return NULL;
37198 : }
37199 0 : static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
37200 0 : PyObject *self, *result;
37201 : #if CYTHON_COMPILING_IN_LIMITED_API
37202 : self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
37203 : if (unlikely(!self) && PyErr_Occurred()) return NULL;
37204 : #else
37205 0 : self = ((PyCFunctionObject*)func)->m_self;
37206 : #endif
37207 0 : result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
37208 0 : return result;
37209 : }
37210 0 : static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
37211 0 : PyObject *result;
37212 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
37213 : #if CYTHON_METH_FASTCALL
37214 0 : __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
37215 0 : if (vc) {
37216 : #if CYTHON_ASSUME_SAFE_MACROS
37217 0 : return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
37218 : #else
37219 : (void) &__Pyx_PyVectorcall_FastCallDict;
37220 : return PyVectorcall_Call(func, args, kw);
37221 : #endif
37222 : }
37223 : #endif
37224 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
37225 0 : Py_ssize_t argc;
37226 0 : PyObject *new_args;
37227 0 : PyObject *self;
37228 : #if CYTHON_ASSUME_SAFE_MACROS
37229 0 : argc = PyTuple_GET_SIZE(args);
37230 : #else
37231 : argc = PyTuple_Size(args);
37232 : if (unlikely(!argc) < 0) return NULL;
37233 : #endif
37234 0 : new_args = PyTuple_GetSlice(args, 1, argc);
37235 0 : if (unlikely(!new_args))
37236 : return NULL;
37237 0 : self = PyTuple_GetItem(args, 0);
37238 0 : if (unlikely(!self)) {
37239 0 : Py_DECREF(new_args);
37240 : #if PY_MAJOR_VERSION > 2
37241 0 : PyErr_Format(PyExc_TypeError,
37242 : "unbound method %.200S() needs an argument",
37243 : cyfunc->func_qualname);
37244 : #else
37245 : PyErr_SetString(PyExc_TypeError,
37246 : "unbound method needs an argument");
37247 : #endif
37248 0 : return NULL;
37249 : }
37250 0 : result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
37251 0 : Py_DECREF(new_args);
37252 : } else {
37253 0 : result = __Pyx_CyFunction_Call(func, args, kw);
37254 : }
37255 : return result;
37256 : }
37257 : #if CYTHON_METH_FASTCALL
37258 15843 : static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
37259 : {
37260 15843 : int ret = 0;
37261 15843 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
37262 0 : if (unlikely(nargs < 1)) {
37263 0 : PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
37264 0 : ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
37265 0 : return -1;
37266 : }
37267 : ret = 1;
37268 : }
37269 15843 : if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
37270 0 : PyErr_Format(PyExc_TypeError,
37271 0 : "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
37272 0 : return -1;
37273 : }
37274 : return ret;
37275 : }
37276 0 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
37277 : {
37278 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
37279 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
37280 : #if CYTHON_BACKPORT_VECTORCALL
37281 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
37282 : #else
37283 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
37284 : #endif
37285 0 : PyObject *self;
37286 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
37287 0 : case 1:
37288 0 : self = args[0];
37289 0 : args += 1;
37290 0 : nargs -= 1;
37291 0 : break;
37292 0 : case 0:
37293 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
37294 0 : break;
37295 : default:
37296 : return NULL;
37297 : }
37298 0 : if (unlikely(nargs != 0)) {
37299 0 : PyErr_Format(PyExc_TypeError,
37300 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
37301 : def->ml_name, nargs);
37302 0 : return NULL;
37303 : }
37304 0 : return def->ml_meth(self, NULL);
37305 : }
37306 0 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
37307 : {
37308 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
37309 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
37310 : #if CYTHON_BACKPORT_VECTORCALL
37311 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
37312 : #else
37313 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
37314 : #endif
37315 0 : PyObject *self;
37316 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
37317 0 : case 1:
37318 0 : self = args[0];
37319 0 : args += 1;
37320 0 : nargs -= 1;
37321 0 : break;
37322 0 : case 0:
37323 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
37324 0 : break;
37325 : default:
37326 : return NULL;
37327 : }
37328 0 : if (unlikely(nargs != 1)) {
37329 0 : PyErr_Format(PyExc_TypeError,
37330 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
37331 : def->ml_name, nargs);
37332 0 : return NULL;
37333 : }
37334 0 : return def->ml_meth(self, args[0]);
37335 : }
37336 15843 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
37337 : {
37338 15843 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
37339 15843 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
37340 : #if CYTHON_BACKPORT_VECTORCALL
37341 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
37342 : #else
37343 15843 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
37344 : #endif
37345 15843 : PyObject *self;
37346 15843 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
37347 0 : case 1:
37348 0 : self = args[0];
37349 0 : args += 1;
37350 0 : nargs -= 1;
37351 0 : break;
37352 15843 : case 0:
37353 15843 : self = ((PyCFunctionObject*)cyfunc)->m_self;
37354 15843 : break;
37355 : default:
37356 : return NULL;
37357 : }
37358 15843 : return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
37359 : }
37360 0 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
37361 : {
37362 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
37363 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
37364 0 : PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
37365 : #if CYTHON_BACKPORT_VECTORCALL
37366 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
37367 : #else
37368 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
37369 : #endif
37370 0 : PyObject *self;
37371 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
37372 0 : case 1:
37373 0 : self = args[0];
37374 0 : args += 1;
37375 0 : nargs -= 1;
37376 0 : break;
37377 0 : case 0:
37378 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
37379 0 : break;
37380 : default:
37381 : return NULL;
37382 : }
37383 0 : return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
37384 : }
37385 : #endif
37386 : #if CYTHON_USE_TYPE_SPECS
37387 : static PyType_Slot __pyx_CyFunctionType_slots[] = {
37388 : {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
37389 : {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
37390 : {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
37391 : {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
37392 : {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
37393 : {Py_tp_methods, (void *)__pyx_CyFunction_methods},
37394 : {Py_tp_members, (void *)__pyx_CyFunction_members},
37395 : {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
37396 : {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
37397 : {0, 0},
37398 : };
37399 : static PyType_Spec __pyx_CyFunctionType_spec = {
37400 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
37401 : sizeof(__pyx_CyFunctionObject),
37402 : 0,
37403 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
37404 : Py_TPFLAGS_METHOD_DESCRIPTOR |
37405 : #endif
37406 : #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
37407 : _Py_TPFLAGS_HAVE_VECTORCALL |
37408 : #endif
37409 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
37410 : __pyx_CyFunctionType_slots
37411 : };
37412 : #else
37413 : static PyTypeObject __pyx_CyFunctionType_type = {
37414 : PyVarObject_HEAD_INIT(0, 0)
37415 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
37416 : sizeof(__pyx_CyFunctionObject),
37417 : 0,
37418 : (destructor) __Pyx_CyFunction_dealloc,
37419 : #if !CYTHON_METH_FASTCALL
37420 : 0,
37421 : #elif CYTHON_BACKPORT_VECTORCALL
37422 : (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
37423 : #else
37424 : offsetof(PyCFunctionObject, vectorcall),
37425 : #endif
37426 : 0,
37427 : 0,
37428 : #if PY_MAJOR_VERSION < 3
37429 : 0,
37430 : #else
37431 : 0,
37432 : #endif
37433 : (reprfunc) __Pyx_CyFunction_repr,
37434 : 0,
37435 : 0,
37436 : 0,
37437 : 0,
37438 : __Pyx_CyFunction_CallAsMethod,
37439 : 0,
37440 : 0,
37441 : 0,
37442 : 0,
37443 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
37444 : Py_TPFLAGS_METHOD_DESCRIPTOR |
37445 : #endif
37446 : #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
37447 : _Py_TPFLAGS_HAVE_VECTORCALL |
37448 : #endif
37449 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
37450 : 0,
37451 : (traverseproc) __Pyx_CyFunction_traverse,
37452 : (inquiry) __Pyx_CyFunction_clear,
37453 : 0,
37454 : #if PY_VERSION_HEX < 0x030500A0
37455 : offsetof(__pyx_CyFunctionObject, func_weakreflist),
37456 : #else
37457 : offsetof(PyCFunctionObject, m_weakreflist),
37458 : #endif
37459 : 0,
37460 : 0,
37461 : __pyx_CyFunction_methods,
37462 : __pyx_CyFunction_members,
37463 : __pyx_CyFunction_getsets,
37464 : 0,
37465 : 0,
37466 : __Pyx_PyMethod_New,
37467 : 0,
37468 : offsetof(__pyx_CyFunctionObject, func_dict),
37469 : 0,
37470 : 0,
37471 : 0,
37472 : 0,
37473 : 0,
37474 : 0,
37475 : 0,
37476 : 0,
37477 : 0,
37478 : 0,
37479 : 0,
37480 : 0,
37481 : #if PY_VERSION_HEX >= 0x030400a1
37482 : 0,
37483 : #endif
37484 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
37485 : 0,
37486 : #endif
37487 : #if __PYX_NEED_TP_PRINT_SLOT
37488 : 0,
37489 : #endif
37490 : #if PY_VERSION_HEX >= 0x030C0000
37491 : 0,
37492 : #endif
37493 : #if PY_VERSION_HEX >= 0x030d00A4
37494 : 0,
37495 : #endif
37496 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
37497 : 0,
37498 : #endif
37499 : };
37500 : #endif
37501 3 : static int __pyx_CyFunction_init(PyObject *module) {
37502 : #if CYTHON_USE_TYPE_SPECS
37503 : __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
37504 : #else
37505 3 : CYTHON_UNUSED_VAR(module);
37506 3 : __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
37507 : #endif
37508 3 : if (unlikely(__pyx_CyFunctionType == NULL)) {
37509 0 : return -1;
37510 : }
37511 : return 0;
37512 : }
37513 3 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
37514 3 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
37515 3 : m->defaults = PyObject_Malloc(size);
37516 3 : if (unlikely(!m->defaults))
37517 0 : return PyErr_NoMemory();
37518 3 : memset(m->defaults, 0, size);
37519 3 : m->defaults_pyobjects = pyobjects;
37520 3 : m->defaults_size = size;
37521 3 : return m->defaults;
37522 : }
37523 18 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
37524 18 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
37525 18 : m->defaults_tuple = tuple;
37526 27 : Py_INCREF(tuple);
37527 : }
37528 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
37529 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
37530 : m->defaults_kwdict = dict;
37531 : Py_INCREF(dict);
37532 : }
37533 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
37534 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
37535 : m->func_annotations = dict;
37536 : Py_INCREF(dict);
37537 : }
37538 :
37539 : /* CythonFunction */
37540 33 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
37541 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
37542 33 : PyObject *op = __Pyx_CyFunction_Init(
37543 33 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
37544 : ml, flags, qualname, closure, module, globals, code
37545 : );
37546 33 : if (likely(op)) {
37547 33 : PyObject_GC_Track(op);
37548 : }
37549 33 : return op;
37550 : }
37551 :
37552 : /* FusedFunction */
37553 : static PyObject *
37554 9 : __pyx_FusedFunction_New(PyMethodDef *ml, int flags,
37555 : PyObject *qualname, PyObject *closure,
37556 : PyObject *module, PyObject *globals,
37557 : PyObject *code)
37558 : {
37559 9 : PyObject *op = __Pyx_CyFunction_Init(
37560 9 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_FusedFunctionType),
37561 : ml, flags, qualname, closure, module, globals, code
37562 : );
37563 9 : if (likely(op)) {
37564 9 : __pyx_FusedFunctionObject *fusedfunc = (__pyx_FusedFunctionObject *) op;
37565 9 : fusedfunc->__signatures__ = NULL;
37566 9 : fusedfunc->self = NULL;
37567 9 : PyObject_GC_Track(op);
37568 : }
37569 9 : return op;
37570 : }
37571 : static void
37572 0 : __pyx_FusedFunction_dealloc(__pyx_FusedFunctionObject *self)
37573 : {
37574 0 : PyObject_GC_UnTrack(self);
37575 0 : Py_CLEAR(self->self);
37576 0 : Py_CLEAR(self->__signatures__);
37577 0 : __Pyx__CyFunction_dealloc((__pyx_CyFunctionObject *) self);
37578 0 : }
37579 : static int
37580 0 : __pyx_FusedFunction_traverse(__pyx_FusedFunctionObject *self,
37581 : visitproc visit,
37582 : void *arg)
37583 : {
37584 0 : Py_VISIT(self->self);
37585 0 : Py_VISIT(self->__signatures__);
37586 0 : return __Pyx_CyFunction_traverse((__pyx_CyFunctionObject *) self, visit, arg);
37587 : }
37588 : static int
37589 0 : __pyx_FusedFunction_clear(__pyx_FusedFunctionObject *self)
37590 : {
37591 0 : Py_CLEAR(self->self);
37592 0 : Py_CLEAR(self->__signatures__);
37593 0 : return __Pyx_CyFunction_clear((__pyx_CyFunctionObject *) self);
37594 : }
37595 : static PyObject *
37596 0 : __pyx_FusedFunction_descr_get(PyObject *self, PyObject *obj, PyObject *type)
37597 : {
37598 0 : __pyx_FusedFunctionObject *func, *meth;
37599 0 : func = (__pyx_FusedFunctionObject *) self;
37600 0 : if (func->self || func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD) {
37601 0 : Py_INCREF(self);
37602 0 : return self;
37603 : }
37604 0 : if (obj == Py_None)
37605 0 : obj = NULL;
37606 0 : if (func->func.flags & __Pyx_CYFUNCTION_CLASSMETHOD)
37607 0 : obj = type;
37608 0 : if (obj == NULL) {
37609 0 : Py_INCREF(self);
37610 0 : return self;
37611 : }
37612 0 : meth = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_New(
37613 : ((PyCFunctionObject *) func)->m_ml,
37614 : ((__pyx_CyFunctionObject *) func)->flags,
37615 : ((__pyx_CyFunctionObject *) func)->func_qualname,
37616 : ((__pyx_CyFunctionObject *) func)->func_closure,
37617 : ((PyCFunctionObject *) func)->m_module,
37618 : ((__pyx_CyFunctionObject *) func)->func_globals,
37619 : ((__pyx_CyFunctionObject *) func)->func_code);
37620 0 : if (unlikely(!meth))
37621 : return NULL;
37622 0 : if (func->func.defaults) {
37623 0 : PyObject **pydefaults;
37624 0 : int i;
37625 0 : if (unlikely(!__Pyx_CyFunction_InitDefaults(
37626 : (PyObject*)meth,
37627 : func->func.defaults_size,
37628 : func->func.defaults_pyobjects))) {
37629 0 : Py_XDECREF((PyObject*)meth);
37630 0 : return NULL;
37631 : }
37632 0 : memcpy(meth->func.defaults, func->func.defaults, func->func.defaults_size);
37633 0 : pydefaults = __Pyx_CyFunction_Defaults(PyObject *, meth);
37634 0 : for (i = 0; i < meth->func.defaults_pyobjects; i++)
37635 0 : Py_XINCREF(pydefaults[i]);
37636 : }
37637 0 : __Pyx_CyFunction_SetClassObj(meth, __Pyx_CyFunction_GetClassObj(func));
37638 0 : Py_XINCREF(func->__signatures__);
37639 0 : meth->__signatures__ = func->__signatures__;
37640 0 : Py_XINCREF(func->func.defaults_tuple);
37641 0 : meth->func.defaults_tuple = func->func.defaults_tuple;
37642 0 : Py_XINCREF(obj);
37643 0 : meth->self = obj;
37644 0 : return (PyObject *) meth;
37645 : }
37646 : static PyObject *
37647 0 : _obj_to_string(PyObject *obj)
37648 : {
37649 0 : if (PyUnicode_CheckExact(obj))
37650 0 : return __Pyx_NewRef(obj);
37651 : #if PY_MAJOR_VERSION == 2
37652 : else if (PyString_Check(obj))
37653 : return PyUnicode_FromEncodedObject(obj, NULL, "strict");
37654 : #endif
37655 0 : else if (PyType_Check(obj))
37656 0 : return PyObject_GetAttr(obj, __pyx_n_s_name_2);
37657 : else
37658 0 : return PyObject_Unicode(obj);
37659 : }
37660 : static PyObject *
37661 0 : __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
37662 : {
37663 0 : PyObject *signature = NULL;
37664 0 : PyObject *unbound_result_func;
37665 0 : PyObject *result_func = NULL;
37666 0 : if (unlikely(self->__signatures__ == NULL)) {
37667 0 : PyErr_SetString(PyExc_TypeError, "Function is not fused");
37668 0 : return NULL;
37669 : }
37670 0 : if (PyTuple_Check(idx)) {
37671 0 : Py_ssize_t n = PyTuple_GET_SIZE(idx);
37672 0 : PyObject *list = PyList_New(n);
37673 0 : int i;
37674 0 : if (unlikely(!list))
37675 : return NULL;
37676 0 : for (i = 0; i < n; i++) {
37677 0 : PyObject *string;
37678 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37679 0 : PyObject *item = PyTuple_GET_ITEM(idx, i);
37680 : #else
37681 : PyObject *item = PySequence_ITEM(idx, i); if (unlikely(!item)) goto __pyx_err;
37682 : #endif
37683 0 : string = _obj_to_string(item);
37684 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
37685 : Py_DECREF(item);
37686 : #endif
37687 0 : if (unlikely(!string)) goto __pyx_err;
37688 0 : PyList_SET_ITEM(list, i, string);
37689 : }
37690 0 : signature = PyUnicode_Join(__pyx_kp_u__14, list);
37691 0 : __pyx_err:;
37692 0 : Py_DECREF(list);
37693 : } else {
37694 0 : signature = _obj_to_string(idx);
37695 : }
37696 0 : if (unlikely(!signature))
37697 : return NULL;
37698 0 : unbound_result_func = PyObject_GetItem(self->__signatures__, signature);
37699 0 : if (likely(unbound_result_func)) {
37700 0 : if (self->self) {
37701 0 : __pyx_FusedFunctionObject *unbound = (__pyx_FusedFunctionObject *) unbound_result_func;
37702 0 : __Pyx_CyFunction_SetClassObj(unbound, __Pyx_CyFunction_GetClassObj(self));
37703 0 : result_func = __pyx_FusedFunction_descr_get(unbound_result_func,
37704 : self->self, self->self);
37705 : } else {
37706 0 : result_func = unbound_result_func;
37707 0 : Py_INCREF(result_func);
37708 : }
37709 : }
37710 0 : Py_DECREF(signature);
37711 0 : Py_XDECREF(unbound_result_func);
37712 0 : return result_func;
37713 : }
37714 : static PyObject *
37715 0 : __pyx_FusedFunction_callfunction(PyObject *func, PyObject *args, PyObject *kw)
37716 : {
37717 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
37718 0 : int static_specialized = (cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD &&
37719 0 : !((__pyx_FusedFunctionObject *) func)->__signatures__);
37720 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !static_specialized) {
37721 0 : return __Pyx_CyFunction_CallAsMethod(func, args, kw);
37722 : } else {
37723 0 : return __Pyx_CyFunction_Call(func, args, kw);
37724 : }
37725 : }
37726 : static PyObject *
37727 0 : __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
37728 : {
37729 0 : __pyx_FusedFunctionObject *binding_func = (__pyx_FusedFunctionObject *) func;
37730 0 : Py_ssize_t argc = PyTuple_GET_SIZE(args);
37731 0 : PyObject *new_args = NULL;
37732 0 : __pyx_FusedFunctionObject *new_func = NULL;
37733 0 : PyObject *result = NULL;
37734 0 : int is_staticmethod = binding_func->func.flags & __Pyx_CYFUNCTION_STATICMETHOD;
37735 0 : if (binding_func->self) {
37736 0 : PyObject *self;
37737 0 : Py_ssize_t i;
37738 0 : new_args = PyTuple_New(argc + 1);
37739 0 : if (unlikely(!new_args))
37740 : return NULL;
37741 0 : self = binding_func->self;
37742 0 : Py_INCREF(self);
37743 0 : PyTuple_SET_ITEM(new_args, 0, self);
37744 0 : self = NULL;
37745 0 : for (i = 0; i < argc; i++) {
37746 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37747 0 : PyObject *item = PyTuple_GET_ITEM(args, i);
37748 0 : Py_INCREF(item);
37749 : #else
37750 : PyObject *item = PySequence_ITEM(args, i); if (unlikely(!item)) goto bad;
37751 : #endif
37752 0 : PyTuple_SET_ITEM(new_args, i + 1, item);
37753 : }
37754 : args = new_args;
37755 : }
37756 0 : if (binding_func->__signatures__) {
37757 0 : PyObject *tup;
37758 0 : if (is_staticmethod && binding_func->func.flags & __Pyx_CYFUNCTION_CCLASS) {
37759 0 : tup = PyTuple_Pack(3, args,
37760 : kw == NULL ? Py_None : kw,
37761 : binding_func->func.defaults_tuple);
37762 0 : if (unlikely(!tup)) goto bad;
37763 0 : new_func = (__pyx_FusedFunctionObject *) __Pyx_CyFunction_CallMethod(
37764 : func, binding_func->__signatures__, tup, NULL);
37765 : } else {
37766 0 : tup = PyTuple_Pack(4, binding_func->__signatures__, args,
37767 : kw == NULL ? Py_None : kw,
37768 : binding_func->func.defaults_tuple);
37769 0 : if (unlikely(!tup)) goto bad;
37770 0 : new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL);
37771 : }
37772 0 : Py_DECREF(tup);
37773 0 : if (unlikely(!new_func))
37774 0 : goto bad;
37775 0 : __Pyx_CyFunction_SetClassObj(new_func, __Pyx_CyFunction_GetClassObj(binding_func));
37776 0 : func = (PyObject *) new_func;
37777 : }
37778 0 : result = __pyx_FusedFunction_callfunction(func, args, kw);
37779 0 : bad:
37780 0 : Py_XDECREF(new_args);
37781 0 : Py_XDECREF((PyObject *) new_func);
37782 0 : return result;
37783 : }
37784 : static PyMemberDef __pyx_FusedFunction_members[] = {
37785 : {(char *) "__signatures__",
37786 : T_OBJECT,
37787 : offsetof(__pyx_FusedFunctionObject, __signatures__),
37788 : READONLY,
37789 : 0},
37790 : {(char *) "__self__", T_OBJECT_EX, offsetof(__pyx_FusedFunctionObject, self), READONLY, 0},
37791 : {0, 0, 0, 0, 0},
37792 : };
37793 : static PyGetSetDef __pyx_FusedFunction_getsets[] = {
37794 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
37795 : {0, 0, 0, 0, 0}
37796 : };
37797 : #if CYTHON_USE_TYPE_SPECS
37798 : static PyType_Slot __pyx_FusedFunctionType_slots[] = {
37799 : {Py_tp_dealloc, (void *)__pyx_FusedFunction_dealloc},
37800 : {Py_tp_call, (void *)__pyx_FusedFunction_call},
37801 : {Py_tp_traverse, (void *)__pyx_FusedFunction_traverse},
37802 : {Py_tp_clear, (void *)__pyx_FusedFunction_clear},
37803 : {Py_tp_members, (void *)__pyx_FusedFunction_members},
37804 : {Py_tp_getset, (void *)__pyx_FusedFunction_getsets},
37805 : {Py_tp_descr_get, (void *)__pyx_FusedFunction_descr_get},
37806 : {Py_mp_subscript, (void *)__pyx_FusedFunction_getitem},
37807 : {0, 0},
37808 : };
37809 : static PyType_Spec __pyx_FusedFunctionType_spec = {
37810 : __PYX_TYPE_MODULE_PREFIX "fused_cython_function",
37811 : sizeof(__pyx_FusedFunctionObject),
37812 : 0,
37813 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
37814 : __pyx_FusedFunctionType_slots
37815 : };
37816 : #else
37817 : static PyMappingMethods __pyx_FusedFunction_mapping_methods = {
37818 : 0,
37819 : (binaryfunc) __pyx_FusedFunction_getitem,
37820 : 0,
37821 : };
37822 : static PyTypeObject __pyx_FusedFunctionType_type = {
37823 : PyVarObject_HEAD_INIT(0, 0)
37824 : __PYX_TYPE_MODULE_PREFIX "fused_cython_function",
37825 : sizeof(__pyx_FusedFunctionObject),
37826 : 0,
37827 : (destructor) __pyx_FusedFunction_dealloc,
37828 : 0,
37829 : 0,
37830 : 0,
37831 : #if PY_MAJOR_VERSION < 3
37832 : 0,
37833 : #else
37834 : 0,
37835 : #endif
37836 : 0,
37837 : 0,
37838 : 0,
37839 : &__pyx_FusedFunction_mapping_methods,
37840 : 0,
37841 : (ternaryfunc) __pyx_FusedFunction_call,
37842 : 0,
37843 : 0,
37844 : 0,
37845 : 0,
37846 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
37847 : 0,
37848 : (traverseproc) __pyx_FusedFunction_traverse,
37849 : (inquiry) __pyx_FusedFunction_clear,
37850 : 0,
37851 : 0,
37852 : 0,
37853 : 0,
37854 : 0,
37855 : __pyx_FusedFunction_members,
37856 : __pyx_FusedFunction_getsets,
37857 : &__pyx_CyFunctionType_type,
37858 : 0,
37859 : __pyx_FusedFunction_descr_get,
37860 : 0,
37861 : 0,
37862 : 0,
37863 : 0,
37864 : 0,
37865 : 0,
37866 : 0,
37867 : 0,
37868 : 0,
37869 : 0,
37870 : 0,
37871 : 0,
37872 : 0,
37873 : 0,
37874 : #if PY_VERSION_HEX >= 0x030400a1
37875 : 0,
37876 : #endif
37877 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
37878 : 0,
37879 : #endif
37880 : #if __PYX_NEED_TP_PRINT_SLOT
37881 : 0,
37882 : #endif
37883 : #if PY_VERSION_HEX >= 0x030C0000
37884 : 0,
37885 : #endif
37886 : #if PY_VERSION_HEX >= 0x030d00A4
37887 : 0,
37888 : #endif
37889 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
37890 : 0,
37891 : #endif
37892 : };
37893 : #endif
37894 3 : static int __pyx_FusedFunction_init(PyObject *module) {
37895 : #if CYTHON_USE_TYPE_SPECS
37896 : PyObject *bases = PyTuple_Pack(1, __pyx_CyFunctionType);
37897 : if (unlikely(!bases)) {
37898 : return -1;
37899 : }
37900 : __pyx_FusedFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_FusedFunctionType_spec, bases);
37901 : Py_DECREF(bases);
37902 : #else
37903 3 : CYTHON_UNUSED_VAR(module);
37904 3 : __pyx_FusedFunctionType_type.tp_base = __pyx_CyFunctionType;
37905 3 : __pyx_FusedFunctionType = __Pyx_FetchCommonType(&__pyx_FusedFunctionType_type);
37906 : #endif
37907 3 : if (unlikely(__pyx_FusedFunctionType == NULL)) {
37908 0 : return -1;
37909 : }
37910 : return 0;
37911 : }
37912 :
37913 : /* CLineInTraceback */
37914 : #ifndef CYTHON_CLINE_IN_TRACEBACK
37915 2080 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
37916 2080 : PyObject *use_cline;
37917 2080 : PyObject *ptype, *pvalue, *ptraceback;
37918 : #if CYTHON_COMPILING_IN_CPYTHON
37919 2080 : PyObject **cython_runtime_dict;
37920 : #endif
37921 2080 : CYTHON_MAYBE_UNUSED_VAR(tstate);
37922 2080 : if (unlikely(!__pyx_cython_runtime)) {
37923 : return c_line;
37924 : }
37925 2080 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
37926 : #if CYTHON_COMPILING_IN_CPYTHON
37927 2080 : cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
37928 2080 : if (likely(cython_runtime_dict)) {
37929 2080 : __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
37930 : use_cline, *cython_runtime_dict,
37931 : __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
37932 : } else
37933 : #endif
37934 : {
37935 0 : PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
37936 0 : if (use_cline_obj) {
37937 0 : use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
37938 0 : Py_DECREF(use_cline_obj);
37939 : } else {
37940 0 : PyErr_Clear();
37941 : use_cline = NULL;
37942 : }
37943 : }
37944 2080 : if (!use_cline) {
37945 0 : c_line = 0;
37946 0 : (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
37947 : }
37948 2080 : else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
37949 : c_line = 0;
37950 : }
37951 2080 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
37952 : return c_line;
37953 : }
37954 : #endif
37955 :
37956 : /* CodeObjectCache */
37957 : #if !CYTHON_COMPILING_IN_LIMITED_API
37958 2083 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
37959 2083 : int start = 0, mid = 0, end = count - 1;
37960 2083 : if (end >= 0 && code_line > entries[end].code_line) {
37961 : return count;
37962 : }
37963 5089 : while (start < end) {
37964 4390 : mid = start + (end - start) / 2;
37965 4390 : if (code_line < entries[mid].code_line) {
37966 : end = mid;
37967 2683 : } else if (code_line > entries[mid].code_line) {
37968 1299 : start = mid + 1;
37969 : } else {
37970 1384 : return mid;
37971 : }
37972 : }
37973 699 : if (code_line <= entries[mid].code_line) {
37974 : return mid;
37975 : } else {
37976 697 : return mid + 1;
37977 : }
37978 : }
37979 2080 : static PyCodeObject *__pyx_find_code_object(int code_line) {
37980 2080 : PyCodeObject* code_object;
37981 2080 : int pos;
37982 2080 : if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
37983 : return NULL;
37984 : }
37985 2079 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
37986 2079 : if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
37987 : return NULL;
37988 : }
37989 2075 : code_object = __pyx_code_cache.entries[pos].code_object;
37990 2075 : Py_INCREF(code_object);
37991 : return code_object;
37992 : }
37993 5 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
37994 5 : int pos, i;
37995 5 : __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
37996 5 : if (unlikely(!code_line)) {
37997 : return;
37998 : }
37999 5 : if (unlikely(!entries)) {
38000 1 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
38001 1 : if (likely(entries)) {
38002 1 : __pyx_code_cache.entries = entries;
38003 1 : __pyx_code_cache.max_count = 64;
38004 1 : __pyx_code_cache.count = 1;
38005 1 : entries[0].code_line = code_line;
38006 1 : entries[0].code_object = code_object;
38007 1 : Py_INCREF(code_object);
38008 : }
38009 1 : return;
38010 : }
38011 4 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
38012 4 : if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
38013 0 : PyCodeObject* tmp = entries[pos].code_object;
38014 0 : entries[pos].code_object = code_object;
38015 0 : Py_DECREF(tmp);
38016 0 : return;
38017 : }
38018 4 : if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
38019 0 : int new_max = __pyx_code_cache.max_count + 64;
38020 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
38021 0 : __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
38022 0 : if (unlikely(!entries)) {
38023 : return;
38024 : }
38025 0 : __pyx_code_cache.entries = entries;
38026 0 : __pyx_code_cache.max_count = new_max;
38027 : }
38028 8 : for (i=__pyx_code_cache.count; i>pos; i--) {
38029 4 : entries[i] = entries[i-1];
38030 : }
38031 4 : entries[pos].code_line = code_line;
38032 4 : entries[pos].code_object = code_object;
38033 4 : __pyx_code_cache.count++;
38034 4 : Py_INCREF(code_object);
38035 : }
38036 : #endif
38037 :
38038 : /* AddTraceback */
38039 : #include "compile.h"
38040 : #include "frameobject.h"
38041 : #include "traceback.h"
38042 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
38043 : #ifndef Py_BUILD_CORE
38044 : #define Py_BUILD_CORE 1
38045 : #endif
38046 : #include "internal/pycore_frame.h"
38047 : #endif
38048 : #if CYTHON_COMPILING_IN_LIMITED_API
38049 : static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
38050 : PyObject *firstlineno, PyObject *name) {
38051 : PyObject *replace = NULL;
38052 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
38053 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
38054 : replace = PyObject_GetAttrString(code, "replace");
38055 : if (likely(replace)) {
38056 : PyObject *result;
38057 : result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
38058 : Py_DECREF(replace);
38059 : return result;
38060 : }
38061 : PyErr_Clear();
38062 : #if __PYX_LIMITED_VERSION_HEX < 0x030780000
38063 : {
38064 : PyObject *compiled = NULL, *result = NULL;
38065 : if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
38066 : if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
38067 : compiled = Py_CompileString(
38068 : "out = type(code)(\n"
38069 : " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
38070 : " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
38071 : " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
38072 : " code.co_lnotab)\n", "<dummy>", Py_file_input);
38073 : if (!compiled) return NULL;
38074 : result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
38075 : Py_DECREF(compiled);
38076 : if (!result) PyErr_Print();
38077 : Py_DECREF(result);
38078 : result = PyDict_GetItemString(scratch_dict, "out");
38079 : if (result) Py_INCREF(result);
38080 : return result;
38081 : }
38082 : #else
38083 : return NULL;
38084 : #endif
38085 : }
38086 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
38087 : int py_line, const char *filename) {
38088 : PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
38089 : PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
38090 : PyObject *exc_type, *exc_value, *exc_traceback;
38091 : int success = 0;
38092 : if (c_line) {
38093 : (void) __pyx_cfilenm;
38094 : (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
38095 : }
38096 : PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
38097 : code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
38098 : if (unlikely(!code_object)) goto bad;
38099 : py_py_line = PyLong_FromLong(py_line);
38100 : if (unlikely(!py_py_line)) goto bad;
38101 : py_funcname = PyUnicode_FromString(funcname);
38102 : if (unlikely(!py_funcname)) goto bad;
38103 : dict = PyDict_New();
38104 : if (unlikely(!dict)) goto bad;
38105 : {
38106 : PyObject *old_code_object = code_object;
38107 : code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
38108 : Py_DECREF(old_code_object);
38109 : }
38110 : if (unlikely(!code_object)) goto bad;
38111 : getframe = PySys_GetObject("_getframe");
38112 : if (unlikely(!getframe)) goto bad;
38113 : if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
38114 : frame = PyEval_EvalCode(code_object, dict, dict);
38115 : if (unlikely(!frame) || frame == Py_None) goto bad;
38116 : success = 1;
38117 : bad:
38118 : PyErr_Restore(exc_type, exc_value, exc_traceback);
38119 : Py_XDECREF(code_object);
38120 : Py_XDECREF(py_py_line);
38121 : Py_XDECREF(py_funcname);
38122 : Py_XDECREF(dict);
38123 : Py_XDECREF(replace);
38124 : if (success) {
38125 : PyTraceBack_Here(
38126 : (struct _frame*)frame);
38127 : }
38128 : Py_XDECREF(frame);
38129 : }
38130 : #else
38131 5 : static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
38132 : const char *funcname, int c_line,
38133 : int py_line, const char *filename) {
38134 5 : PyCodeObject *py_code = NULL;
38135 5 : PyObject *py_funcname = NULL;
38136 : #if PY_MAJOR_VERSION < 3
38137 : PyObject *py_srcfile = NULL;
38138 : py_srcfile = PyString_FromString(filename);
38139 : if (!py_srcfile) goto bad;
38140 : #endif
38141 5 : if (c_line) {
38142 : #if PY_MAJOR_VERSION < 3
38143 : py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
38144 : if (!py_funcname) goto bad;
38145 : #else
38146 0 : py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
38147 0 : if (!py_funcname) goto bad;
38148 0 : funcname = PyUnicode_AsUTF8(py_funcname);
38149 0 : if (!funcname) goto bad;
38150 : #endif
38151 : }
38152 : else {
38153 : #if PY_MAJOR_VERSION < 3
38154 : py_funcname = PyString_FromString(funcname);
38155 : if (!py_funcname) goto bad;
38156 : #endif
38157 : }
38158 : #if PY_MAJOR_VERSION < 3
38159 : py_code = __Pyx_PyCode_New(
38160 : 0,
38161 : 0,
38162 : 0,
38163 : 0,
38164 : 0,
38165 : 0,
38166 : __pyx_empty_bytes, /*PyObject *code,*/
38167 : __pyx_empty_tuple, /*PyObject *consts,*/
38168 : __pyx_empty_tuple, /*PyObject *names,*/
38169 : __pyx_empty_tuple, /*PyObject *varnames,*/
38170 : __pyx_empty_tuple, /*PyObject *freevars,*/
38171 : __pyx_empty_tuple, /*PyObject *cellvars,*/
38172 : py_srcfile, /*PyObject *filename,*/
38173 : py_funcname, /*PyObject *name,*/
38174 : py_line,
38175 : __pyx_empty_bytes /*PyObject *lnotab*/
38176 : );
38177 : Py_DECREF(py_srcfile);
38178 : #else
38179 5 : py_code = PyCode_NewEmpty(filename, funcname, py_line);
38180 : #endif
38181 5 : Py_XDECREF(py_funcname);
38182 5 : return py_code;
38183 0 : bad:
38184 0 : Py_XDECREF(py_funcname);
38185 : #if PY_MAJOR_VERSION < 3
38186 : Py_XDECREF(py_srcfile);
38187 : #endif
38188 0 : return NULL;
38189 : }
38190 2080 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
38191 : int py_line, const char *filename) {
38192 2080 : PyCodeObject *py_code = 0;
38193 2080 : PyFrameObject *py_frame = 0;
38194 2080 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
38195 2080 : PyObject *ptype, *pvalue, *ptraceback;
38196 2080 : if (c_line) {
38197 2080 : c_line = __Pyx_CLineForTraceback(tstate, c_line);
38198 : }
38199 4160 : py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
38200 2080 : if (!py_code) {
38201 5 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
38202 5 : py_code = __Pyx_CreateCodeObjectForTraceback(
38203 : funcname, c_line, py_line, filename);
38204 5 : if (!py_code) {
38205 : /* If the code object creation fails, then we should clear the
38206 : fetched exception references and propagate the new exception */
38207 0 : Py_XDECREF(ptype);
38208 0 : Py_XDECREF(pvalue);
38209 0 : Py_XDECREF(ptraceback);
38210 0 : goto bad;
38211 : }
38212 5 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
38213 5 : __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
38214 : }
38215 2080 : py_frame = PyFrame_New(
38216 : tstate, /*PyThreadState *tstate,*/
38217 : py_code, /*PyCodeObject *code,*/
38218 : __pyx_d, /*PyObject *globals,*/
38219 : 0 /*PyObject *locals*/
38220 : );
38221 2080 : if (!py_frame) goto bad;
38222 2080 : __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
38223 2080 : PyTraceBack_Here(py_frame);
38224 2080 : bad:
38225 2080 : Py_XDECREF(py_code);
38226 2080 : Py_XDECREF(py_frame);
38227 2080 : }
38228 : #endif
38229 :
38230 : #if PY_MAJOR_VERSION < 3
38231 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
38232 : __Pyx_TypeName obj_type_name;
38233 : if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
38234 : if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
38235 : if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
38236 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
38237 : PyErr_Format(PyExc_TypeError,
38238 : "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
38239 : obj_type_name);
38240 : __Pyx_DECREF_TypeName(obj_type_name);
38241 : return -1;
38242 : }
38243 : static void __Pyx_ReleaseBuffer(Py_buffer *view) {
38244 : PyObject *obj = view->obj;
38245 : if (!obj) return;
38246 : if (PyObject_CheckBuffer(obj)) {
38247 : PyBuffer_Release(view);
38248 : return;
38249 : }
38250 : if ((0)) {}
38251 : view->obj = NULL;
38252 : Py_DECREF(obj);
38253 : }
38254 : #endif
38255 :
38256 :
38257 : /* MemviewSliceIsContig */
38258 : static int
38259 6570108 : __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
38260 : {
38261 6570108 : int i, index, step, start;
38262 6570108 : Py_ssize_t itemsize = mvs.memview->view.itemsize;
38263 6570108 : if (order == 'F') {
38264 : step = 1;
38265 : start = 0;
38266 : } else {
38267 6570108 : step = -1;
38268 6570108 : start = ndim - 1;
38269 : }
38270 13140216 : for (i = 0; i < ndim; i++) {
38271 6570108 : index = start + step * i;
38272 6570108 : if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
38273 : return 0;
38274 6570108 : itemsize *= mvs.shape[index];
38275 : }
38276 : return 1;
38277 : }
38278 :
38279 : /* OverlappingSlices */
38280 : static void
38281 6570108 : __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
38282 : void **out_start, void **out_end,
38283 : int ndim, size_t itemsize)
38284 : {
38285 6570108 : char *start, *end;
38286 6570108 : int i;
38287 6570108 : start = end = slice->data;
38288 13140216 : for (i = 0; i < ndim; i++) {
38289 6570108 : Py_ssize_t stride = slice->strides[i];
38290 6570108 : Py_ssize_t extent = slice->shape[i];
38291 6570108 : if (extent == 0) {
38292 0 : *out_start = *out_end = start;
38293 0 : return;
38294 : } else {
38295 6570108 : if (stride > 0)
38296 6570108 : end += stride * (extent - 1);
38297 : else
38298 0 : start += stride * (extent - 1);
38299 : }
38300 : }
38301 6570108 : *out_start = start;
38302 6570108 : *out_end = end + itemsize;
38303 : }
38304 : static int
38305 3285054 : __pyx_slices_overlap(__Pyx_memviewslice *slice1,
38306 : __Pyx_memviewslice *slice2,
38307 : int ndim, size_t itemsize)
38308 : {
38309 3285054 : void *start1, *end1, *start2, *end2;
38310 3285054 : __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
38311 3285054 : __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
38312 3285054 : return (start1 < end2) && (start2 < end1);
38313 : }
38314 :
38315 : /* IsLittleEndian */
38316 0 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
38317 : {
38318 0 : union {
38319 : uint32_t u32;
38320 : uint8_t u8[4];
38321 : } S;
38322 0 : S.u32 = 0x01020304;
38323 0 : return S.u8[0] == 4;
38324 : }
38325 :
38326 : /* BufferFormatCheck */
38327 75717 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
38328 : __Pyx_BufFmt_StackElem* stack,
38329 : __Pyx_TypeInfo* type) {
38330 75717 : stack[0].field = &ctx->root;
38331 75717 : stack[0].parent_offset = 0;
38332 75717 : ctx->root.type = type;
38333 75717 : ctx->root.name = "buffer dtype";
38334 75717 : ctx->root.offset = 0;
38335 75717 : ctx->head = stack;
38336 75717 : ctx->head->field = &ctx->root;
38337 75717 : ctx->fmt_offset = 0;
38338 75717 : ctx->head->parent_offset = 0;
38339 75717 : ctx->new_packmode = '@';
38340 75717 : ctx->enc_packmode = '@';
38341 75717 : ctx->new_count = 1;
38342 75717 : ctx->enc_count = 0;
38343 75717 : ctx->enc_type = 0;
38344 75717 : ctx->is_complex = 0;
38345 75717 : ctx->is_valid_array = 0;
38346 75717 : ctx->struct_alignment = 0;
38347 75717 : while (type->typegroup == 'S') {
38348 0 : ++ctx->head;
38349 0 : ctx->head->field = type->fields;
38350 0 : ctx->head->parent_offset = 0;
38351 0 : type = type->fields->type;
38352 : }
38353 75717 : }
38354 0 : static int __Pyx_BufFmt_ParseNumber(const char** ts) {
38355 0 : int count;
38356 0 : const char* t = *ts;
38357 0 : if (*t < '0' || *t > '9') {
38358 : return -1;
38359 : } else {
38360 0 : count = *t++ - '0';
38361 0 : while (*t >= '0' && *t <= '9') {
38362 0 : count *= 10;
38363 0 : count += *t++ - '0';
38364 : }
38365 : }
38366 0 : *ts = t;
38367 0 : return count;
38368 : }
38369 0 : static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
38370 0 : int number = __Pyx_BufFmt_ParseNumber(ts);
38371 0 : if (number == -1)
38372 0 : PyErr_Format(PyExc_ValueError,\
38373 0 : "Does not understand character buffer dtype format string ('%c')", **ts);
38374 0 : return number;
38375 : }
38376 0 : static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
38377 0 : PyErr_Format(PyExc_ValueError,
38378 : "Unexpected format string character: '%c'", ch);
38379 : }
38380 0 : static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
38381 0 : switch (ch) {
38382 : case '?': return "'bool'";
38383 0 : case 'c': return "'char'";
38384 0 : case 'b': return "'signed char'";
38385 0 : case 'B': return "'unsigned char'";
38386 0 : case 'h': return "'short'";
38387 0 : case 'H': return "'unsigned short'";
38388 0 : case 'i': return "'int'";
38389 0 : case 'I': return "'unsigned int'";
38390 0 : case 'l': return "'long'";
38391 0 : case 'L': return "'unsigned long'";
38392 0 : case 'q': return "'long long'";
38393 0 : case 'Q': return "'unsigned long long'";
38394 0 : case 'f': return (is_complex ? "'complex float'" : "'float'");
38395 0 : case 'd': return (is_complex ? "'complex double'" : "'double'");
38396 0 : case 'g': return (is_complex ? "'complex long double'" : "'long double'");
38397 0 : case 'T': return "a struct";
38398 0 : case 'O': return "Python object";
38399 0 : case 'P': return "a pointer";
38400 0 : case 's': case 'p': return "a string";
38401 0 : case 0: return "end";
38402 0 : default: return "unparsable format string";
38403 : }
38404 : }
38405 0 : static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
38406 0 : switch (ch) {
38407 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
38408 0 : case 'h': case 'H': return 2;
38409 : case 'i': case 'I': case 'l': case 'L': return 4;
38410 : case 'q': case 'Q': return 8;
38411 0 : case 'f': return (is_complex ? 8 : 4);
38412 0 : case 'd': return (is_complex ? 16 : 8);
38413 0 : case 'g': {
38414 0 : PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
38415 0 : return 0;
38416 : }
38417 : case 'O': case 'P': return sizeof(void*);
38418 0 : default:
38419 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
38420 0 : return 0;
38421 : }
38422 : }
38423 75717 : static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
38424 75717 : switch (ch) {
38425 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
38426 0 : case 'h': case 'H': return sizeof(short);
38427 : case 'i': case 'I': return sizeof(int);
38428 : case 'l': case 'L': return sizeof(long);
38429 : #ifdef HAVE_LONG_LONG
38430 : case 'q': case 'Q': return sizeof(PY_LONG_LONG);
38431 : #endif
38432 0 : case 'f': return sizeof(float) * (is_complex ? 2 : 1);
38433 72596 : case 'd': return sizeof(double) * (is_complex ? 2 : 1);
38434 0 : case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
38435 : case 'O': case 'P': return sizeof(void*);
38436 0 : default: {
38437 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
38438 0 : return 0;
38439 : }
38440 : }
38441 : }
38442 : typedef struct { char c; short x; } __Pyx_st_short;
38443 : typedef struct { char c; int x; } __Pyx_st_int;
38444 : typedef struct { char c; long x; } __Pyx_st_long;
38445 : typedef struct { char c; float x; } __Pyx_st_float;
38446 : typedef struct { char c; double x; } __Pyx_st_double;
38447 : typedef struct { char c; long double x; } __Pyx_st_longdouble;
38448 : typedef struct { char c; void *x; } __Pyx_st_void_p;
38449 : #ifdef HAVE_LONG_LONG
38450 : typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
38451 : #endif
38452 75717 : static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
38453 75717 : CYTHON_UNUSED_VAR(is_complex);
38454 75717 : switch (ch) {
38455 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
38456 0 : case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
38457 : case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
38458 : case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
38459 : #ifdef HAVE_LONG_LONG
38460 : case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
38461 : #endif
38462 : case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
38463 : case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
38464 0 : case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
38465 : case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
38466 0 : default:
38467 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
38468 0 : return 0;
38469 : }
38470 : }
38471 : /* These are for computing the padding at the end of the struct to align
38472 : on the first member of the struct. This will probably the same as above,
38473 : but we don't have any guarantees.
38474 : */
38475 : typedef struct { short x; char c; } __Pyx_pad_short;
38476 : typedef struct { int x; char c; } __Pyx_pad_int;
38477 : typedef struct { long x; char c; } __Pyx_pad_long;
38478 : typedef struct { float x; char c; } __Pyx_pad_float;
38479 : typedef struct { double x; char c; } __Pyx_pad_double;
38480 : typedef struct { long double x; char c; } __Pyx_pad_longdouble;
38481 : typedef struct { void *x; char c; } __Pyx_pad_void_p;
38482 : #ifdef HAVE_LONG_LONG
38483 : typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
38484 : #endif
38485 75717 : static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
38486 75717 : CYTHON_UNUSED_VAR(is_complex);
38487 75717 : switch (ch) {
38488 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
38489 0 : case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
38490 : case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
38491 : case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
38492 : #ifdef HAVE_LONG_LONG
38493 : case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
38494 : #endif
38495 : case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
38496 : case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
38497 0 : case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
38498 : case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
38499 0 : default:
38500 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
38501 0 : return 0;
38502 : }
38503 : }
38504 75717 : static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
38505 75717 : switch (ch) {
38506 : case 'c':
38507 : return 'H';
38508 3121 : case 'b': case 'h': case 'i':
38509 3121 : case 'l': case 'q': case 's': case 'p':
38510 3121 : return 'I';
38511 0 : case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
38512 0 : return 'U';
38513 72596 : case 'f': case 'd': case 'g':
38514 72596 : return (is_complex ? 'C' : 'R');
38515 0 : case 'O':
38516 0 : return 'O';
38517 0 : case 'P':
38518 0 : return 'P';
38519 0 : default: {
38520 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
38521 0 : return 0;
38522 : }
38523 : }
38524 : }
38525 0 : static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
38526 0 : if (ctx->head == NULL || ctx->head->field == &ctx->root) {
38527 0 : const char* expected;
38528 0 : const char* quote;
38529 0 : if (ctx->head == NULL) {
38530 : expected = "end";
38531 : quote = "";
38532 : } else {
38533 0 : expected = ctx->head->field->type->name;
38534 0 : quote = "'";
38535 : }
38536 0 : PyErr_Format(PyExc_ValueError,
38537 : "Buffer dtype mismatch, expected %s%s%s but got %s",
38538 : quote, expected, quote,
38539 0 : __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
38540 0 : } else {
38541 0 : __Pyx_StructField* field = ctx->head->field;
38542 0 : __Pyx_StructField* parent = (ctx->head - 1)->field;
38543 0 : PyErr_Format(PyExc_ValueError,
38544 : "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
38545 0 : field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
38546 0 : parent->type->name, field->name);
38547 : }
38548 0 : }
38549 151434 : static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
38550 151434 : char group;
38551 151434 : size_t size, offset, arraysize = 1;
38552 151434 : if (ctx->enc_type == 0) return 0;
38553 75717 : if (ctx->head->field->type->arraysize[0]) {
38554 0 : int i, ndim = 0;
38555 0 : if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
38556 0 : ctx->is_valid_array = ctx->head->field->type->ndim == 1;
38557 0 : ndim = 1;
38558 0 : if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
38559 0 : PyErr_Format(PyExc_ValueError,
38560 : "Expected a dimension of size %zu, got %zu",
38561 : ctx->head->field->type->arraysize[0], ctx->enc_count);
38562 0 : return -1;
38563 : }
38564 : }
38565 0 : if (!ctx->is_valid_array) {
38566 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
38567 : ctx->head->field->type->ndim, ndim);
38568 0 : return -1;
38569 : }
38570 0 : for (i = 0; i < ctx->head->field->type->ndim; i++) {
38571 0 : arraysize *= ctx->head->field->type->arraysize[i];
38572 : }
38573 0 : ctx->is_valid_array = 0;
38574 0 : ctx->enc_count = 1;
38575 : }
38576 75717 : group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
38577 75717 : do {
38578 75717 : __Pyx_StructField* field = ctx->head->field;
38579 75717 : __Pyx_TypeInfo* type = field->type;
38580 75717 : if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
38581 75717 : size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
38582 : } else {
38583 0 : size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
38584 : }
38585 75717 : if (ctx->enc_packmode == '@') {
38586 75717 : size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
38587 75717 : size_t align_mod_offset;
38588 75717 : if (align_at == 0) return -1;
38589 75717 : align_mod_offset = ctx->fmt_offset % align_at;
38590 75717 : if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
38591 75717 : if (ctx->struct_alignment == 0)
38592 75717 : ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
38593 : ctx->is_complex);
38594 : }
38595 75717 : if (type->size != size || type->typegroup != group) {
38596 0 : if (type->typegroup == 'C' && type->fields != NULL) {
38597 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
38598 0 : ++ctx->head;
38599 0 : ctx->head->field = type->fields;
38600 0 : ctx->head->parent_offset = parent_offset;
38601 0 : continue;
38602 0 : }
38603 0 : if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
38604 : } else {
38605 0 : __Pyx_BufFmt_RaiseExpected(ctx);
38606 0 : return -1;
38607 : }
38608 : }
38609 75717 : offset = ctx->head->parent_offset + field->offset;
38610 75717 : if (ctx->fmt_offset != offset) {
38611 0 : PyErr_Format(PyExc_ValueError,
38612 : "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
38613 : (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
38614 0 : return -1;
38615 : }
38616 75717 : ctx->fmt_offset += size;
38617 75717 : if (arraysize)
38618 75717 : ctx->fmt_offset += (arraysize - 1) * size;
38619 75717 : --ctx->enc_count;
38620 75717 : while (1) {
38621 75717 : if (field == &ctx->root) {
38622 75717 : ctx->head = NULL;
38623 75717 : if (ctx->enc_count != 0) {
38624 0 : __Pyx_BufFmt_RaiseExpected(ctx);
38625 0 : return -1;
38626 : }
38627 : break;
38628 : }
38629 0 : ctx->head->field = ++field;
38630 0 : if (field->type == NULL) {
38631 0 : --ctx->head;
38632 0 : field = ctx->head->field;
38633 0 : continue;
38634 0 : } else if (field->type->typegroup == 'S') {
38635 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
38636 0 : if (field->type->fields->type == NULL) continue;
38637 0 : field = field->type->fields;
38638 0 : ++ctx->head;
38639 0 : ctx->head->field = field;
38640 0 : ctx->head->parent_offset = parent_offset;
38641 0 : break;
38642 : } else {
38643 : break;
38644 : }
38645 : }
38646 75717 : } while (ctx->enc_count);
38647 75717 : ctx->enc_type = 0;
38648 75717 : ctx->is_complex = 0;
38649 75717 : return 0;
38650 : }
38651 : static int
38652 0 : __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
38653 : {
38654 0 : const char *ts = *tsp;
38655 0 : int i = 0, number, ndim;
38656 0 : ++ts;
38657 0 : if (ctx->new_count != 1) {
38658 0 : PyErr_SetString(PyExc_ValueError,
38659 : "Cannot handle repeated arrays in format string");
38660 0 : return -1;
38661 : }
38662 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
38663 0 : ndim = ctx->head->field->type->ndim;
38664 0 : while (*ts && *ts != ')') {
38665 0 : switch (*ts) {
38666 0 : case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
38667 0 : default: break;
38668 : }
38669 0 : number = __Pyx_BufFmt_ExpectNumber(&ts);
38670 0 : if (number == -1) return -1;
38671 0 : if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
38672 0 : PyErr_Format(PyExc_ValueError,
38673 : "Expected a dimension of size %zu, got %d",
38674 : ctx->head->field->type->arraysize[i], number);
38675 0 : return -1;
38676 : }
38677 0 : if (*ts != ',' && *ts != ')') {
38678 0 : PyErr_Format(PyExc_ValueError,
38679 : "Expected a comma in format string, got '%c'", *ts);
38680 0 : return -1;
38681 : }
38682 0 : if (*ts == ',') ts++;
38683 0 : i++;
38684 : }
38685 0 : if (i != ndim) {
38686 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
38687 0 : ctx->head->field->type->ndim, i);
38688 0 : return -1;
38689 : }
38690 0 : if (!*ts) {
38691 0 : PyErr_SetString(PyExc_ValueError,
38692 : "Unexpected end of format string, expected ')'");
38693 0 : return -1;
38694 : }
38695 0 : ctx->is_valid_array = 1;
38696 0 : ctx->new_count = 1;
38697 0 : *tsp = ++ts;
38698 0 : return 0;
38699 : }
38700 75717 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
38701 75717 : int got_Z = 0;
38702 151434 : while (1) {
38703 151434 : switch(*ts) {
38704 75717 : case 0:
38705 75717 : if (ctx->enc_type != 0 && ctx->head == NULL) {
38706 0 : __Pyx_BufFmt_RaiseExpected(ctx);
38707 0 : return NULL;
38708 : }
38709 75717 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
38710 75717 : if (ctx->head != NULL) {
38711 0 : __Pyx_BufFmt_RaiseExpected(ctx);
38712 0 : return NULL;
38713 : }
38714 : return ts;
38715 0 : case ' ':
38716 0 : case '\r':
38717 0 : case '\n':
38718 0 : ++ts;
38719 0 : break;
38720 0 : case '<':
38721 0 : if (!__Pyx_Is_Little_Endian()) {
38722 : PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
38723 : return NULL;
38724 : }
38725 0 : ctx->new_packmode = '=';
38726 0 : ++ts;
38727 0 : break;
38728 0 : case '>':
38729 0 : case '!':
38730 0 : if (__Pyx_Is_Little_Endian()) {
38731 0 : PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
38732 0 : return NULL;
38733 : }
38734 : ctx->new_packmode = '=';
38735 : ++ts;
38736 : break;
38737 0 : case '=':
38738 0 : case '@':
38739 0 : case '^':
38740 0 : ctx->new_packmode = *ts++;
38741 0 : break;
38742 0 : case 'T':
38743 0 : {
38744 0 : const char* ts_after_sub;
38745 0 : size_t i, struct_count = ctx->new_count;
38746 0 : size_t struct_alignment = ctx->struct_alignment;
38747 0 : ctx->new_count = 1;
38748 0 : ++ts;
38749 0 : if (*ts != '{') {
38750 0 : PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
38751 0 : return NULL;
38752 : }
38753 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
38754 0 : ctx->enc_type = 0;
38755 0 : ctx->enc_count = 0;
38756 0 : ctx->struct_alignment = 0;
38757 0 : ++ts;
38758 0 : ts_after_sub = ts;
38759 0 : for (i = 0; i != struct_count; ++i) {
38760 0 : ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
38761 0 : if (!ts_after_sub) return NULL;
38762 : }
38763 0 : ts = ts_after_sub;
38764 0 : if (struct_alignment) ctx->struct_alignment = struct_alignment;
38765 : }
38766 : break;
38767 0 : case '}':
38768 0 : {
38769 0 : size_t alignment = ctx->struct_alignment;
38770 0 : ++ts;
38771 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
38772 0 : ctx->enc_type = 0;
38773 0 : if (alignment && ctx->fmt_offset % alignment) {
38774 0 : ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
38775 : }
38776 : }
38777 : return ts;
38778 0 : case 'x':
38779 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
38780 0 : ctx->fmt_offset += ctx->new_count;
38781 0 : ctx->new_count = 1;
38782 0 : ctx->enc_count = 0;
38783 0 : ctx->enc_type = 0;
38784 0 : ctx->enc_packmode = ctx->new_packmode;
38785 0 : ++ts;
38786 0 : break;
38787 0 : case 'Z':
38788 0 : got_Z = 1;
38789 0 : ++ts;
38790 0 : if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
38791 0 : __Pyx_BufFmt_RaiseUnexpectedChar('Z');
38792 0 : return NULL;
38793 : }
38794 75717 : CYTHON_FALLTHROUGH;
38795 75717 : case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
38796 75717 : case 'l': case 'L': case 'q': case 'Q':
38797 75717 : case 'f': case 'd': case 'g':
38798 75717 : case 'O': case 'p':
38799 75717 : if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
38800 0 : (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
38801 0 : ctx->enc_count += ctx->new_count;
38802 0 : ctx->new_count = 1;
38803 0 : got_Z = 0;
38804 0 : ++ts;
38805 0 : break;
38806 : }
38807 75717 : CYTHON_FALLTHROUGH;
38808 75717 : case 's':
38809 75717 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
38810 75717 : ctx->enc_count = ctx->new_count;
38811 75717 : ctx->enc_packmode = ctx->new_packmode;
38812 75717 : ctx->enc_type = *ts;
38813 75717 : ctx->is_complex = got_Z;
38814 75717 : ++ts;
38815 75717 : ctx->new_count = 1;
38816 75717 : got_Z = 0;
38817 75717 : break;
38818 0 : case ':':
38819 0 : ++ts;
38820 0 : while(*ts != ':') ++ts;
38821 0 : ++ts;
38822 0 : break;
38823 0 : case '(':
38824 0 : if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
38825 : break;
38826 0 : default:
38827 0 : {
38828 0 : int number = __Pyx_BufFmt_ExpectNumber(&ts);
38829 0 : if (number == -1) return NULL;
38830 0 : ctx->new_count = (size_t)number;
38831 : }
38832 : }
38833 : }
38834 : }
38835 :
38836 : /* TypeInfoCompare */
38837 : static int
38838 0 : __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
38839 : {
38840 0 : int i;
38841 0 : if (!a || !b)
38842 : return 0;
38843 0 : if (a == b)
38844 : return 1;
38845 0 : if (a->size != b->size || a->typegroup != b->typegroup ||
38846 0 : a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
38847 0 : if (a->typegroup == 'H' || b->typegroup == 'H') {
38848 0 : return a->size == b->size;
38849 : } else {
38850 : return 0;
38851 : }
38852 : }
38853 0 : if (a->ndim) {
38854 0 : for (i = 0; i < a->ndim; i++)
38855 0 : if (a->arraysize[i] != b->arraysize[i])
38856 : return 0;
38857 : }
38858 0 : if (a->typegroup == 'S') {
38859 0 : if (a->flags != b->flags)
38860 : return 0;
38861 0 : if (a->fields || b->fields) {
38862 0 : if (!(a->fields && b->fields))
38863 : return 0;
38864 0 : for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
38865 0 : __Pyx_StructField *field_a = a->fields + i;
38866 0 : __Pyx_StructField *field_b = b->fields + i;
38867 0 : if (field_a->offset != field_b->offset ||
38868 0 : !__pyx_typeinfo_cmp(field_a->type, field_b->type))
38869 0 : return 0;
38870 : }
38871 0 : return !a->fields[i].type && !b->fields[i].type;
38872 : }
38873 : }
38874 : return 1;
38875 : }
38876 :
38877 : /* MemviewSliceValidateAndInit */
38878 : static int
38879 103357 : __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
38880 : {
38881 103357 : if (buf->shape[dim] <= 1)
38882 : return 1;
38883 71841 : if (buf->strides) {
38884 71841 : if (spec & __Pyx_MEMVIEW_CONTIG) {
38885 52444 : if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
38886 0 : if (unlikely(buf->strides[dim] != sizeof(void *))) {
38887 0 : PyErr_Format(PyExc_ValueError,
38888 : "Buffer is not indirectly contiguous "
38889 : "in dimension %d.", dim);
38890 0 : goto fail;
38891 : }
38892 52444 : } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
38893 0 : PyErr_SetString(PyExc_ValueError,
38894 : "Buffer and memoryview are not contiguous "
38895 : "in the same dimension.");
38896 0 : goto fail;
38897 : }
38898 : }
38899 71841 : if (spec & __Pyx_MEMVIEW_FOLLOW) {
38900 19000 : Py_ssize_t stride = buf->strides[dim];
38901 19000 : if (stride < 0)
38902 : stride = -stride;
38903 19000 : if (unlikely(stride < buf->itemsize)) {
38904 0 : PyErr_SetString(PyExc_ValueError,
38905 : "Buffer and memoryview are not contiguous "
38906 : "in the same dimension.");
38907 0 : goto fail;
38908 : }
38909 : }
38910 : } else {
38911 0 : if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
38912 0 : PyErr_Format(PyExc_ValueError,
38913 : "C-contiguous buffer is not contiguous in "
38914 : "dimension %d", dim);
38915 0 : goto fail;
38916 0 : } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
38917 0 : PyErr_Format(PyExc_ValueError,
38918 : "C-contiguous buffer is not indirect in "
38919 : "dimension %d", dim);
38920 0 : goto fail;
38921 0 : } else if (unlikely(buf->suboffsets)) {
38922 0 : PyErr_SetString(PyExc_ValueError,
38923 : "Buffer exposes suboffsets but no strides");
38924 0 : goto fail;
38925 : }
38926 : }
38927 : return 1;
38928 : fail:
38929 : return 0;
38930 : }
38931 : static int
38932 103357 : __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
38933 : {
38934 103357 : CYTHON_UNUSED_VAR(ndim);
38935 103357 : if (spec & __Pyx_MEMVIEW_DIRECT) {
38936 103357 : if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
38937 0 : PyErr_Format(PyExc_ValueError,
38938 : "Buffer not compatible with direct access "
38939 : "in dimension %d.", dim);
38940 0 : goto fail;
38941 : }
38942 : }
38943 103357 : if (spec & __Pyx_MEMVIEW_PTR) {
38944 0 : if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
38945 0 : PyErr_Format(PyExc_ValueError,
38946 : "Buffer is not indirectly accessible "
38947 : "in dimension %d.", dim);
38948 0 : goto fail;
38949 : }
38950 : }
38951 : return 1;
38952 : fail:
38953 : return 0;
38954 : }
38955 : static int
38956 75375 : __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
38957 : {
38958 75375 : int i;
38959 75375 : if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
38960 : Py_ssize_t stride = 1;
38961 10665 : for (i = 0; i < ndim; i++) {
38962 7110 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
38963 0 : PyErr_SetString(PyExc_ValueError,
38964 : "Buffer not fortran contiguous.");
38965 0 : goto fail;
38966 : }
38967 7110 : stride = stride * buf->shape[i];
38968 : }
38969 71820 : } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
38970 71619 : Py_ssize_t stride = 1;
38971 167464 : for (i = ndim - 1; i >- 1; i--) {
38972 95845 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
38973 0 : PyErr_SetString(PyExc_ValueError,
38974 : "Buffer not C contiguous.");
38975 0 : goto fail;
38976 : }
38977 95845 : stride = stride * buf->shape[i];
38978 : }
38979 : }
38980 : return 1;
38981 : fail:
38982 : return 0;
38983 : }
38984 75718 : static int __Pyx_ValidateAndInit_memviewslice(
38985 : int *axes_specs,
38986 : int c_or_f_flag,
38987 : int buf_flags,
38988 : int ndim,
38989 : __Pyx_TypeInfo *dtype,
38990 : __Pyx_BufFmt_StackElem stack[],
38991 : __Pyx_memviewslice *memviewslice,
38992 : PyObject *original_obj)
38993 : {
38994 75718 : struct __pyx_memoryview_obj *memview, *new_memview;
38995 : __Pyx_RefNannyDeclarations
38996 75718 : Py_buffer *buf;
38997 75718 : int i, spec = 0, retval = -1;
38998 75718 : __Pyx_BufFmt_Context ctx;
38999 75718 : int from_memoryview = __pyx_memoryview_check(original_obj);
39000 75718 : __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
39001 75718 : if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
39002 : original_obj)->typeinfo)) {
39003 : memview = (struct __pyx_memoryview_obj *) original_obj;
39004 : new_memview = NULL;
39005 : } else {
39006 75718 : memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
39007 : original_obj, buf_flags, 0, dtype);
39008 75718 : new_memview = memview;
39009 75718 : if (unlikely(!memview))
39010 0 : goto fail;
39011 : }
39012 75718 : buf = &memview->view;
39013 75718 : if (unlikely(buf->ndim != ndim)) {
39014 1 : PyErr_Format(PyExc_ValueError,
39015 : "Buffer has wrong number of dimensions (expected %d, got %d)",
39016 : ndim, buf->ndim);
39017 1 : goto fail;
39018 : }
39019 75717 : if (new_memview) {
39020 75717 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
39021 75717 : if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
39022 : }
39023 75717 : if (unlikely((unsigned) buf->itemsize != dtype->size)) {
39024 0 : PyErr_Format(PyExc_ValueError,
39025 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
39026 : "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
39027 : buf->itemsize,
39028 : (buf->itemsize > 1) ? "s" : "",
39029 : dtype->name,
39030 : dtype->size,
39031 : (dtype->size > 1) ? "s" : "");
39032 0 : goto fail;
39033 : }
39034 75717 : if (buf->len > 0) {
39035 178732 : for (i = 0; i < ndim; i++) {
39036 103357 : spec = axes_specs[i];
39037 103357 : if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
39038 0 : goto fail;
39039 103357 : if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
39040 0 : goto fail;
39041 : }
39042 75375 : if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
39043 0 : goto fail;
39044 : }
39045 75717 : if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
39046 : new_memview != NULL) == -1)) {
39047 0 : goto fail;
39048 : }
39049 75717 : retval = 0;
39050 75717 : goto no_fail;
39051 1 : fail:
39052 1 : Py_XDECREF(new_memview);
39053 : retval = -1;
39054 75718 : no_fail:
39055 75718 : __Pyx_RefNannyFinishContext();
39056 75718 : return retval;
39057 : }
39058 :
39059 : /* ObjectToMemviewSlice */
39060 55 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32(PyObject *obj, int writable_flag) {
39061 55 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39062 55 : __Pyx_BufFmt_StackElem stack[1];
39063 55 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39064 55 : int retcode;
39065 55 : if (obj == Py_None) {
39066 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39067 0 : return result;
39068 : }
39069 55 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39070 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39071 : &__Pyx_TypeInfo_nn_npy_int32, stack,
39072 : &result, obj);
39073 55 : if (unlikely(retcode == -1))
39074 0 : goto __pyx_fail;
39075 : return result;
39076 0 : __pyx_fail:
39077 0 : result.memview = NULL;
39078 0 : result.data = NULL;
39079 0 : return result;
39080 : }
39081 :
39082 : /* ObjectToMemviewSlice */
39083 145 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int64(PyObject *obj, int writable_flag) {
39084 145 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39085 145 : __Pyx_BufFmt_StackElem stack[1];
39086 145 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39087 145 : int retcode;
39088 145 : if (obj == Py_None) {
39089 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39090 0 : return result;
39091 : }
39092 145 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39093 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39094 : &__Pyx_TypeInfo_nn_npy_int64, stack,
39095 : &result, obj);
39096 145 : if (unlikely(retcode == -1))
39097 0 : goto __pyx_fail;
39098 : return result;
39099 0 : __pyx_fail:
39100 0 : result.memview = NULL;
39101 0 : result.data = NULL;
39102 0 : return result;
39103 : }
39104 :
39105 : /* ObjectToMemviewSlice */
39106 29687 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double__const__(PyObject *obj, int writable_flag) {
39107 29687 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39108 29687 : __Pyx_BufFmt_StackElem stack[1];
39109 29687 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39110 29687 : int retcode;
39111 29687 : if (obj == Py_None) {
39112 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39113 0 : return result;
39114 : }
39115 29687 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39116 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39117 : &__Pyx_TypeInfo_double__const__, stack,
39118 : &result, obj);
39119 29687 : if (unlikely(retcode == -1))
39120 0 : goto __pyx_fail;
39121 : return result;
39122 0 : __pyx_fail:
39123 0 : result.memview = NULL;
39124 0 : result.data = NULL;
39125 0 : return result;
39126 : }
39127 :
39128 : /* CIntFromPyVerify */
39129 : #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
39130 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
39131 : #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
39132 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
39133 : #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
39134 : {\
39135 : func_type value = func_value;\
39136 : if (sizeof(target_type) < sizeof(func_type)) {\
39137 : if (unlikely(value != (func_type) (target_type) value)) {\
39138 : func_type zero = 0;\
39139 : if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
39140 : return (target_type) -1;\
39141 : if (is_unsigned && unlikely(value < zero))\
39142 : goto raise_neg_overflow;\
39143 : else\
39144 : goto raise_overflow;\
39145 : }\
39146 : }\
39147 : return (target_type) value;\
39148 : }
39149 :
39150 : /* ObjectToMemviewSlice */
39151 11909 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double__const__(PyObject *obj, int writable_flag) {
39152 11909 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39153 11909 : __Pyx_BufFmt_StackElem stack[1];
39154 11909 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39155 11909 : int retcode;
39156 11909 : if (obj == Py_None) {
39157 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39158 0 : return result;
39159 : }
39160 11909 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39161 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
39162 : &__Pyx_TypeInfo_double__const__, stack,
39163 : &result, obj);
39164 11909 : if (unlikely(retcode == -1))
39165 1 : goto __pyx_fail;
39166 : return result;
39167 1 : __pyx_fail:
39168 1 : result.memview = NULL;
39169 1 : result.data = NULL;
39170 1 : return result;
39171 : }
39172 :
39173 : /* ObjectToMemviewSlice */
39174 12461 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
39175 12461 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39176 12461 : __Pyx_BufFmt_StackElem stack[1];
39177 12461 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39178 12461 : int retcode;
39179 12461 : if (obj == Py_None) {
39180 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39181 0 : return result;
39182 : }
39183 12461 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39184 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
39185 : &__Pyx_TypeInfo_double, stack,
39186 : &result, obj);
39187 12461 : if (unlikely(retcode == -1))
39188 0 : goto __pyx_fail;
39189 : return result;
39190 0 : __pyx_fail:
39191 0 : result.memview = NULL;
39192 0 : result.data = NULL;
39193 0 : return result;
39194 : }
39195 :
39196 : /* ObjectToMemviewSlice */
39197 3555 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) {
39198 3555 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39199 3555 : __Pyx_BufFmt_StackElem stack[1];
39200 3555 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
39201 3555 : int retcode;
39202 3555 : if (obj == Py_None) {
39203 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39204 0 : return result;
39205 : }
39206 3555 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
39207 : (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
39208 : &__Pyx_TypeInfo_double, stack,
39209 : &result, obj);
39210 3555 : if (unlikely(retcode == -1))
39211 0 : goto __pyx_fail;
39212 : return result;
39213 0 : __pyx_fail:
39214 0 : result.memview = NULL;
39215 0 : result.data = NULL;
39216 0 : return result;
39217 : }
39218 :
39219 : /* ObjectToMemviewSlice */
39220 692 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_int32__const__(PyObject *obj, int writable_flag) {
39221 692 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39222 692 : __Pyx_BufFmt_StackElem stack[1];
39223 692 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39224 692 : int retcode;
39225 692 : if (obj == Py_None) {
39226 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39227 0 : return result;
39228 : }
39229 692 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39230 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39231 : &__Pyx_TypeInfo_nn_npy_int32__const__, stack,
39232 : &result, obj);
39233 692 : if (unlikely(retcode == -1))
39234 0 : goto __pyx_fail;
39235 : return result;
39236 0 : __pyx_fail:
39237 0 : result.memview = NULL;
39238 0 : result.data = NULL;
39239 0 : return result;
39240 : }
39241 :
39242 : /* ObjectToMemviewSlice */
39243 201 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *obj, int writable_flag) {
39244 201 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39245 201 : __Pyx_BufFmt_StackElem stack[1];
39246 201 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39247 201 : int retcode;
39248 201 : if (obj == Py_None) {
39249 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39250 0 : return result;
39251 : }
39252 201 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39253 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39254 : &__Pyx_TypeInfo_int, stack,
39255 : &result, obj);
39256 201 : if (unlikely(retcode == -1))
39257 0 : goto __pyx_fail;
39258 : return result;
39259 0 : __pyx_fail:
39260 0 : result.memview = NULL;
39261 0 : result.data = NULL;
39262 0 : return result;
39263 : }
39264 :
39265 : /* ObjectToMemviewSlice */
39266 346 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp__const__(PyObject *obj, int writable_flag) {
39267 346 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39268 346 : __Pyx_BufFmt_StackElem stack[1];
39269 346 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39270 346 : int retcode;
39271 346 : if (obj == Py_None) {
39272 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39273 0 : return result;
39274 : }
39275 346 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39276 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39277 : &__Pyx_TypeInfo_nn_npy_intp__const__, stack,
39278 : &result, obj);
39279 346 : if (unlikely(retcode == -1))
39280 0 : goto __pyx_fail;
39281 : return result;
39282 0 : __pyx_fail:
39283 0 : result.memview = NULL;
39284 0 : result.data = NULL;
39285 0 : return result;
39286 : }
39287 :
39288 : /* ObjectToMemviewSlice */
39289 201 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_nn_npy_intp__const__(PyObject *obj, int writable_flag) {
39290 201 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39291 201 : __Pyx_BufFmt_StackElem stack[1];
39292 201 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
39293 201 : int retcode;
39294 201 : if (obj == Py_None) {
39295 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39296 0 : return result;
39297 : }
39298 201 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
39299 : PyBUF_RECORDS_RO | writable_flag, 2,
39300 : &__Pyx_TypeInfo_nn_npy_intp__const__, stack,
39301 : &result, obj);
39302 201 : if (unlikely(retcode == -1))
39303 0 : goto __pyx_fail;
39304 : return result;
39305 0 : __pyx_fail:
39306 0 : result.memview = NULL;
39307 0 : result.data = NULL;
39308 0 : return result;
39309 : }
39310 :
39311 : /* ObjectToMemviewSlice */
39312 145 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn_npy_intp__const__(PyObject *obj, int writable_flag) {
39313 145 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39314 145 : __Pyx_BufFmt_StackElem stack[1];
39315 145 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39316 145 : int retcode;
39317 145 : if (obj == Py_None) {
39318 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39319 0 : return result;
39320 : }
39321 145 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39322 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
39323 : &__Pyx_TypeInfo_nn_npy_intp__const__, stack,
39324 : &result, obj);
39325 145 : if (unlikely(retcode == -1))
39326 0 : goto __pyx_fail;
39327 : return result;
39328 0 : __pyx_fail:
39329 0 : result.memview = NULL;
39330 0 : result.data = NULL;
39331 0 : return result;
39332 : }
39333 :
39334 : /* ObjectToMemviewSlice */
39335 700 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_Py_ssize_t(PyObject *obj, int writable_flag) {
39336 700 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39337 700 : __Pyx_BufFmt_StackElem stack[1];
39338 700 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39339 700 : int retcode;
39340 700 : if (obj == Py_None) {
39341 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39342 0 : return result;
39343 : }
39344 700 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39345 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39346 : &__Pyx_TypeInfo_Py_ssize_t, stack,
39347 : &result, obj);
39348 700 : if (unlikely(retcode == -1))
39349 0 : goto __pyx_fail;
39350 : return result;
39351 0 : __pyx_fail:
39352 0 : result.memview = NULL;
39353 0 : result.data = NULL;
39354 0 : return result;
39355 : }
39356 :
39357 : /* ObjectToMemviewSlice */
39358 14985 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj, int writable_flag) {
39359 14985 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39360 14985 : __Pyx_BufFmt_StackElem stack[1];
39361 14985 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39362 14985 : int retcode;
39363 14985 : if (obj == Py_None) {
39364 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39365 0 : return result;
39366 : }
39367 14985 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39368 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39369 : &__Pyx_TypeInfo_double, stack,
39370 : &result, obj);
39371 14985 : if (unlikely(retcode == -1))
39372 0 : goto __pyx_fail;
39373 : return result;
39374 0 : __pyx_fail:
39375 0 : result.memview = NULL;
39376 0 : result.data = NULL;
39377 0 : return result;
39378 : }
39379 :
39380 : /* PyUCS4InUnicode */
39381 : #if PY_VERSION_HEX < 0x03090000 || (defined(PyUnicode_WCHAR_KIND) && defined(PyUnicode_AS_UNICODE))
39382 : #if PY_VERSION_HEX < 0x03090000
39383 : #define __Pyx_PyUnicode_AS_UNICODE(op) PyUnicode_AS_UNICODE(op)
39384 : #define __Pyx_PyUnicode_GET_SIZE(op) PyUnicode_GET_SIZE(op)
39385 : #else
39386 : #define __Pyx_PyUnicode_AS_UNICODE(op) (((PyASCIIObject *)(op))->wstr)
39387 : #define __Pyx_PyUnicode_GET_SIZE(op) ((PyCompactUnicodeObject *)(op))->wstr_length
39388 : #endif
39389 : #if !defined(Py_UNICODE_SIZE) || Py_UNICODE_SIZE == 2
39390 : static int __Pyx_PyUnicodeBufferContainsUCS4_SP(Py_UNICODE* buffer, Py_ssize_t length, Py_UCS4 character) {
39391 : Py_UNICODE high_val, low_val;
39392 : Py_UNICODE* pos;
39393 : high_val = (Py_UNICODE) (0xD800 | (((character - 0x10000) >> 10) & ((1<<10)-1)));
39394 : low_val = (Py_UNICODE) (0xDC00 | ( (character - 0x10000) & ((1<<10)-1)));
39395 : for (pos=buffer; pos < buffer+length-1; pos++) {
39396 : if (unlikely((high_val == pos[0]) & (low_val == pos[1]))) return 1;
39397 : }
39398 : return 0;
39399 : }
39400 : #endif
39401 : static int __Pyx_PyUnicodeBufferContainsUCS4_BMP(Py_UNICODE* buffer, Py_ssize_t length, Py_UCS4 character) {
39402 : Py_UNICODE uchar;
39403 : Py_UNICODE* pos;
39404 : uchar = (Py_UNICODE) character;
39405 : for (pos=buffer; pos < buffer+length; pos++) {
39406 : if (unlikely(uchar == pos[0])) return 1;
39407 : }
39408 : return 0;
39409 : }
39410 : #endif
39411 : static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 character) {
39412 : #if CYTHON_PEP393_ENABLED
39413 : const int kind = PyUnicode_KIND(unicode);
39414 : #ifdef PyUnicode_WCHAR_KIND
39415 : if (likely(kind != PyUnicode_WCHAR_KIND))
39416 : #endif
39417 : {
39418 : Py_ssize_t i;
39419 : const void* udata = PyUnicode_DATA(unicode);
39420 : const Py_ssize_t length = PyUnicode_GET_LENGTH(unicode);
39421 : for (i=0; i < length; i++) {
39422 : if (unlikely(character == PyUnicode_READ(kind, udata, i))) return 1;
39423 : }
39424 : return 0;
39425 : }
39426 : #elif PY_VERSION_HEX >= 0x03090000
39427 : #error Cannot use "UChar in Unicode" in Python 3.9 without PEP-393 unicode strings.
39428 : #elif !defined(PyUnicode_AS_UNICODE)
39429 : #error Cannot use "UChar in Unicode" in Python < 3.9 without Py_UNICODE support.
39430 : #endif
39431 : #if PY_VERSION_HEX < 0x03090000 || (defined(PyUnicode_WCHAR_KIND) && defined(PyUnicode_AS_UNICODE))
39432 : #if !defined(Py_UNICODE_SIZE) || Py_UNICODE_SIZE == 2
39433 : if ((sizeof(Py_UNICODE) == 2) && unlikely(character > 65535)) {
39434 : return __Pyx_PyUnicodeBufferContainsUCS4_SP(
39435 : __Pyx_PyUnicode_AS_UNICODE(unicode),
39436 : __Pyx_PyUnicode_GET_SIZE(unicode),
39437 : character);
39438 : } else
39439 : #endif
39440 : {
39441 : return __Pyx_PyUnicodeBufferContainsUCS4_BMP(
39442 : __Pyx_PyUnicode_AS_UNICODE(unicode),
39443 : __Pyx_PyUnicode_GET_SIZE(unicode),
39444 : character);
39445 : }
39446 : #endif
39447 : }
39448 :
39449 : /* MemviewDtypeToObject */
39450 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
39451 0 : return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
39452 : }
39453 0 : static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
39454 0 : double value = __pyx_PyFloat_AsDouble(obj);
39455 0 : if (unlikely((value == (double)-1) && PyErr_Occurred()))
39456 : return 0;
39457 0 : *(double *) itemp = value;
39458 0 : return 1;
39459 : }
39460 :
39461 : /* MemviewDtypeToObject */
39462 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn_npy_int32(const char *itemp) {
39463 0 : return (PyObject *) __Pyx_PyInt_From_npy_int32(*(npy_int32 *) itemp);
39464 : }
39465 0 : static CYTHON_INLINE int __pyx_memview_set_nn_npy_int32(const char *itemp, PyObject *obj) {
39466 0 : npy_int32 value = __Pyx_PyInt_As_npy_int32(obj);
39467 0 : if (unlikely((value == ((npy_int32)-1)) && PyErr_Occurred()))
39468 : return 0;
39469 0 : *(npy_int32 *) itemp = value;
39470 0 : return 1;
39471 : }
39472 :
39473 : /* MemviewDtypeToObject */
39474 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn_npy_int64(const char *itemp) {
39475 0 : return (PyObject *) __Pyx_PyInt_From_npy_int64(*(npy_int64 *) itemp);
39476 : }
39477 0 : static CYTHON_INLINE int __pyx_memview_set_nn_npy_int64(const char *itemp, PyObject *obj) {
39478 0 : npy_int64 value = __Pyx_PyInt_As_npy_int64(obj);
39479 0 : if (unlikely((value == ((npy_int64)-1)) && PyErr_Occurred()))
39480 : return 0;
39481 0 : *(npy_int64 *) itemp = value;
39482 0 : return 1;
39483 : }
39484 :
39485 : /* MemviewDtypeToObject */
39486 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_double__const__(const char *itemp) {
39487 0 : return (PyObject *) PyFloat_FromDouble(*(double const *) itemp);
39488 : }
39489 :
39490 : /* ObjectToMemviewSlice */
39491 636 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn_npy_intp(PyObject *obj, int writable_flag) {
39492 636 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
39493 636 : __Pyx_BufFmt_StackElem stack[1];
39494 636 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
39495 636 : int retcode;
39496 636 : if (obj == Py_None) {
39497 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
39498 0 : return result;
39499 : }
39500 636 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
39501 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
39502 : &__Pyx_TypeInfo_nn_npy_intp, stack,
39503 : &result, obj);
39504 636 : if (unlikely(retcode == -1))
39505 0 : goto __pyx_fail;
39506 : return result;
39507 0 : __pyx_fail:
39508 0 : result.memview = NULL;
39509 0 : result.data = NULL;
39510 0 : return result;
39511 : }
39512 :
39513 : /* MemviewDtypeToObject */
39514 2142 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn_npy_int32__const__(const char *itemp) {
39515 4284 : return (PyObject *) __Pyx_PyInt_From_npy_int32(*(npy_int32 const *) itemp);
39516 : }
39517 :
39518 : /* MemviewDtypeToObject */
39519 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_Py_ssize_t(const char *itemp) {
39520 0 : return (PyObject *) PyInt_FromSsize_t(*(Py_ssize_t *) itemp);
39521 : }
39522 0 : static CYTHON_INLINE int __pyx_memview_set_Py_ssize_t(const char *itemp, PyObject *obj) {
39523 0 : Py_ssize_t value = PyInt_AsSsize_t(obj);
39524 0 : if (unlikely((value == (Py_ssize_t)-1) && PyErr_Occurred()))
39525 : return 0;
39526 0 : *(Py_ssize_t *) itemp = value;
39527 0 : return 1;
39528 : }
39529 :
39530 : /* Declarations */
39531 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
39532 : #ifdef __cplusplus
39533 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
39534 : return ::std::complex< float >(x, y);
39535 : }
39536 : #else
39537 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
39538 : return x + y*(__pyx_t_float_complex)_Complex_I;
39539 : }
39540 : #endif
39541 : #else
39542 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
39543 : __pyx_t_float_complex z;
39544 : z.real = x;
39545 : z.imag = y;
39546 : return z;
39547 : }
39548 : #endif
39549 :
39550 : /* Arithmetic */
39551 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
39552 : #else
39553 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39554 : return (a.real == b.real) && (a.imag == b.imag);
39555 : }
39556 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39557 : __pyx_t_float_complex z;
39558 : z.real = a.real + b.real;
39559 : z.imag = a.imag + b.imag;
39560 : return z;
39561 : }
39562 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39563 : __pyx_t_float_complex z;
39564 : z.real = a.real - b.real;
39565 : z.imag = a.imag - b.imag;
39566 : return z;
39567 : }
39568 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39569 : __pyx_t_float_complex z;
39570 : z.real = a.real * b.real - a.imag * b.imag;
39571 : z.imag = a.real * b.imag + a.imag * b.real;
39572 : return z;
39573 : }
39574 : #if 1
39575 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39576 : if (b.imag == 0) {
39577 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
39578 : } else if (fabsf(b.real) >= fabsf(b.imag)) {
39579 : if (b.real == 0 && b.imag == 0) {
39580 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
39581 : } else {
39582 : float r = b.imag / b.real;
39583 : float s = (float)(1.0) / (b.real + b.imag * r);
39584 : return __pyx_t_float_complex_from_parts(
39585 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
39586 : }
39587 : } else {
39588 : float r = b.real / b.imag;
39589 : float s = (float)(1.0) / (b.imag + b.real * r);
39590 : return __pyx_t_float_complex_from_parts(
39591 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
39592 : }
39593 : }
39594 : #else
39595 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39596 : if (b.imag == 0) {
39597 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
39598 : } else {
39599 : float denom = b.real * b.real + b.imag * b.imag;
39600 : return __pyx_t_float_complex_from_parts(
39601 : (a.real * b.real + a.imag * b.imag) / denom,
39602 : (a.imag * b.real - a.real * b.imag) / denom);
39603 : }
39604 : }
39605 : #endif
39606 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
39607 : __pyx_t_float_complex z;
39608 : z.real = -a.real;
39609 : z.imag = -a.imag;
39610 : return z;
39611 : }
39612 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
39613 : return (a.real == 0) && (a.imag == 0);
39614 : }
39615 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
39616 : __pyx_t_float_complex z;
39617 : z.real = a.real;
39618 : z.imag = -a.imag;
39619 : return z;
39620 : }
39621 : #if 1
39622 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
39623 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
39624 : return sqrtf(z.real*z.real + z.imag*z.imag);
39625 : #else
39626 : return hypotf(z.real, z.imag);
39627 : #endif
39628 : }
39629 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
39630 : __pyx_t_float_complex z;
39631 : float r, lnr, theta, z_r, z_theta;
39632 : if (b.imag == 0 && b.real == (int)b.real) {
39633 : if (b.real < 0) {
39634 : float denom = a.real * a.real + a.imag * a.imag;
39635 : a.real = a.real / denom;
39636 : a.imag = -a.imag / denom;
39637 : b.real = -b.real;
39638 : }
39639 : switch ((int)b.real) {
39640 : case 0:
39641 : z.real = 1;
39642 : z.imag = 0;
39643 : return z;
39644 : case 1:
39645 : return a;
39646 : case 2:
39647 : return __Pyx_c_prod_float(a, a);
39648 : case 3:
39649 : z = __Pyx_c_prod_float(a, a);
39650 : return __Pyx_c_prod_float(z, a);
39651 : case 4:
39652 : z = __Pyx_c_prod_float(a, a);
39653 : return __Pyx_c_prod_float(z, z);
39654 : }
39655 : }
39656 : if (a.imag == 0) {
39657 : if (a.real == 0) {
39658 : return a;
39659 : } else if ((b.imag == 0) && (a.real >= 0)) {
39660 : z.real = powf(a.real, b.real);
39661 : z.imag = 0;
39662 : return z;
39663 : } else if (a.real > 0) {
39664 : r = a.real;
39665 : theta = 0;
39666 : } else {
39667 : r = -a.real;
39668 : theta = atan2f(0.0, -1.0);
39669 : }
39670 : } else {
39671 : r = __Pyx_c_abs_float(a);
39672 : theta = atan2f(a.imag, a.real);
39673 : }
39674 : lnr = logf(r);
39675 : z_r = expf(lnr * b.real - theta * b.imag);
39676 : z_theta = theta * b.real + lnr * b.imag;
39677 : z.real = z_r * cosf(z_theta);
39678 : z.imag = z_r * sinf(z_theta);
39679 : return z;
39680 : }
39681 : #endif
39682 : #endif
39683 :
39684 : /* Declarations */
39685 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
39686 : #ifdef __cplusplus
39687 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
39688 : return ::std::complex< double >(x, y);
39689 : }
39690 : #else
39691 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
39692 : return x + y*(__pyx_t_double_complex)_Complex_I;
39693 : }
39694 : #endif
39695 : #else
39696 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
39697 : __pyx_t_double_complex z;
39698 : z.real = x;
39699 : z.imag = y;
39700 : return z;
39701 : }
39702 : #endif
39703 :
39704 : /* Arithmetic */
39705 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
39706 : #else
39707 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39708 : return (a.real == b.real) && (a.imag == b.imag);
39709 : }
39710 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39711 : __pyx_t_double_complex z;
39712 : z.real = a.real + b.real;
39713 : z.imag = a.imag + b.imag;
39714 : return z;
39715 : }
39716 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39717 : __pyx_t_double_complex z;
39718 : z.real = a.real - b.real;
39719 : z.imag = a.imag - b.imag;
39720 : return z;
39721 : }
39722 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39723 : __pyx_t_double_complex z;
39724 : z.real = a.real * b.real - a.imag * b.imag;
39725 : z.imag = a.real * b.imag + a.imag * b.real;
39726 : return z;
39727 : }
39728 : #if 1
39729 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39730 : if (b.imag == 0) {
39731 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
39732 : } else if (fabs(b.real) >= fabs(b.imag)) {
39733 : if (b.real == 0 && b.imag == 0) {
39734 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
39735 : } else {
39736 : double r = b.imag / b.real;
39737 : double s = (double)(1.0) / (b.real + b.imag * r);
39738 : return __pyx_t_double_complex_from_parts(
39739 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
39740 : }
39741 : } else {
39742 : double r = b.real / b.imag;
39743 : double s = (double)(1.0) / (b.imag + b.real * r);
39744 : return __pyx_t_double_complex_from_parts(
39745 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
39746 : }
39747 : }
39748 : #else
39749 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39750 : if (b.imag == 0) {
39751 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
39752 : } else {
39753 : double denom = b.real * b.real + b.imag * b.imag;
39754 : return __pyx_t_double_complex_from_parts(
39755 : (a.real * b.real + a.imag * b.imag) / denom,
39756 : (a.imag * b.real - a.real * b.imag) / denom);
39757 : }
39758 : }
39759 : #endif
39760 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
39761 : __pyx_t_double_complex z;
39762 : z.real = -a.real;
39763 : z.imag = -a.imag;
39764 : return z;
39765 : }
39766 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
39767 : return (a.real == 0) && (a.imag == 0);
39768 : }
39769 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
39770 : __pyx_t_double_complex z;
39771 : z.real = a.real;
39772 : z.imag = -a.imag;
39773 : return z;
39774 : }
39775 : #if 1
39776 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
39777 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
39778 : return sqrt(z.real*z.real + z.imag*z.imag);
39779 : #else
39780 : return hypot(z.real, z.imag);
39781 : #endif
39782 : }
39783 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
39784 : __pyx_t_double_complex z;
39785 : double r, lnr, theta, z_r, z_theta;
39786 : if (b.imag == 0 && b.real == (int)b.real) {
39787 : if (b.real < 0) {
39788 : double denom = a.real * a.real + a.imag * a.imag;
39789 : a.real = a.real / denom;
39790 : a.imag = -a.imag / denom;
39791 : b.real = -b.real;
39792 : }
39793 : switch ((int)b.real) {
39794 : case 0:
39795 : z.real = 1;
39796 : z.imag = 0;
39797 : return z;
39798 : case 1:
39799 : return a;
39800 : case 2:
39801 : return __Pyx_c_prod_double(a, a);
39802 : case 3:
39803 : z = __Pyx_c_prod_double(a, a);
39804 : return __Pyx_c_prod_double(z, a);
39805 : case 4:
39806 : z = __Pyx_c_prod_double(a, a);
39807 : return __Pyx_c_prod_double(z, z);
39808 : }
39809 : }
39810 : if (a.imag == 0) {
39811 : if (a.real == 0) {
39812 : return a;
39813 : } else if ((b.imag == 0) && (a.real >= 0)) {
39814 : z.real = pow(a.real, b.real);
39815 : z.imag = 0;
39816 : return z;
39817 : } else if (a.real > 0) {
39818 : r = a.real;
39819 : theta = 0;
39820 : } else {
39821 : r = -a.real;
39822 : theta = atan2(0.0, -1.0);
39823 : }
39824 : } else {
39825 : r = __Pyx_c_abs_double(a);
39826 : theta = atan2(a.imag, a.real);
39827 : }
39828 : lnr = log(r);
39829 : z_r = exp(lnr * b.real - theta * b.imag);
39830 : z_theta = theta * b.real + lnr * b.imag;
39831 : z.real = z_r * cos(z_theta);
39832 : z.imag = z_r * sin(z_theta);
39833 : return z;
39834 : }
39835 : #endif
39836 : #endif
39837 :
39838 : /* Declarations */
39839 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
39840 : #ifdef __cplusplus
39841 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
39842 : return ::std::complex< long double >(x, y);
39843 : }
39844 : #else
39845 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
39846 : return x + y*(__pyx_t_long_double_complex)_Complex_I;
39847 : }
39848 : #endif
39849 : #else
39850 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
39851 : __pyx_t_long_double_complex z;
39852 : z.real = x;
39853 : z.imag = y;
39854 : return z;
39855 : }
39856 : #endif
39857 :
39858 : /* Arithmetic */
39859 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
39860 : #else
39861 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
39862 : return (a.real == b.real) && (a.imag == b.imag);
39863 : }
39864 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
39865 : __pyx_t_long_double_complex z;
39866 : z.real = a.real + b.real;
39867 : z.imag = a.imag + b.imag;
39868 : return z;
39869 : }
39870 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
39871 : __pyx_t_long_double_complex z;
39872 : z.real = a.real - b.real;
39873 : z.imag = a.imag - b.imag;
39874 : return z;
39875 : }
39876 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
39877 : __pyx_t_long_double_complex z;
39878 : z.real = a.real * b.real - a.imag * b.imag;
39879 : z.imag = a.real * b.imag + a.imag * b.real;
39880 : return z;
39881 : }
39882 : #if 1
39883 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
39884 : if (b.imag == 0) {
39885 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
39886 : } else if (fabsl(b.real) >= fabsl(b.imag)) {
39887 : if (b.real == 0 && b.imag == 0) {
39888 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
39889 : } else {
39890 : long double r = b.imag / b.real;
39891 : long double s = (long double)(1.0) / (b.real + b.imag * r);
39892 : return __pyx_t_long_double_complex_from_parts(
39893 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
39894 : }
39895 : } else {
39896 : long double r = b.real / b.imag;
39897 : long double s = (long double)(1.0) / (b.imag + b.real * r);
39898 : return __pyx_t_long_double_complex_from_parts(
39899 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
39900 : }
39901 : }
39902 : #else
39903 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
39904 : if (b.imag == 0) {
39905 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
39906 : } else {
39907 : long double denom = b.real * b.real + b.imag * b.imag;
39908 : return __pyx_t_long_double_complex_from_parts(
39909 : (a.real * b.real + a.imag * b.imag) / denom,
39910 : (a.imag * b.real - a.real * b.imag) / denom);
39911 : }
39912 : }
39913 : #endif
39914 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
39915 : __pyx_t_long_double_complex z;
39916 : z.real = -a.real;
39917 : z.imag = -a.imag;
39918 : return z;
39919 : }
39920 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
39921 : return (a.real == 0) && (a.imag == 0);
39922 : }
39923 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
39924 : __pyx_t_long_double_complex z;
39925 : z.real = a.real;
39926 : z.imag = -a.imag;
39927 : return z;
39928 : }
39929 : #if 1
39930 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
39931 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
39932 : return sqrtl(z.real*z.real + z.imag*z.imag);
39933 : #else
39934 : return hypotl(z.real, z.imag);
39935 : #endif
39936 : }
39937 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
39938 : __pyx_t_long_double_complex z;
39939 : long double r, lnr, theta, z_r, z_theta;
39940 : if (b.imag == 0 && b.real == (int)b.real) {
39941 : if (b.real < 0) {
39942 : long double denom = a.real * a.real + a.imag * a.imag;
39943 : a.real = a.real / denom;
39944 : a.imag = -a.imag / denom;
39945 : b.real = -b.real;
39946 : }
39947 : switch ((int)b.real) {
39948 : case 0:
39949 : z.real = 1;
39950 : z.imag = 0;
39951 : return z;
39952 : case 1:
39953 : return a;
39954 : case 2:
39955 : return __Pyx_c_prod_long__double(a, a);
39956 : case 3:
39957 : z = __Pyx_c_prod_long__double(a, a);
39958 : return __Pyx_c_prod_long__double(z, a);
39959 : case 4:
39960 : z = __Pyx_c_prod_long__double(a, a);
39961 : return __Pyx_c_prod_long__double(z, z);
39962 : }
39963 : }
39964 : if (a.imag == 0) {
39965 : if (a.real == 0) {
39966 : return a;
39967 : } else if ((b.imag == 0) && (a.real >= 0)) {
39968 : z.real = powl(a.real, b.real);
39969 : z.imag = 0;
39970 : return z;
39971 : } else if (a.real > 0) {
39972 : r = a.real;
39973 : theta = 0;
39974 : } else {
39975 : r = -a.real;
39976 : theta = atan2l(0.0, -1.0);
39977 : }
39978 : } else {
39979 : r = __Pyx_c_abs_long__double(a);
39980 : theta = atan2l(a.imag, a.real);
39981 : }
39982 : lnr = logl(r);
39983 : z_r = expl(lnr * b.real - theta * b.imag);
39984 : z_theta = theta * b.real + lnr * b.imag;
39985 : z.real = z_r * cosl(z_theta);
39986 : z.imag = z_r * sinl(z_theta);
39987 : return z;
39988 : }
39989 : #endif
39990 : #endif
39991 :
39992 : /* MemviewSliceCopyTemplate */
39993 : static __Pyx_memviewslice
39994 0 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
39995 : const char *mode, int ndim,
39996 : size_t sizeof_dtype, int contig_flag,
39997 : int dtype_is_object)
39998 : {
39999 : __Pyx_RefNannyDeclarations
40000 0 : int i;
40001 0 : __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
40002 0 : struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
40003 0 : Py_buffer *buf = &from_memview->view;
40004 0 : PyObject *shape_tuple = NULL;
40005 0 : PyObject *temp_int = NULL;
40006 0 : struct __pyx_array_obj *array_obj = NULL;
40007 0 : struct __pyx_memoryview_obj *memview_obj = NULL;
40008 0 : __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
40009 0 : for (i = 0; i < ndim; i++) {
40010 0 : if (unlikely(from_mvs->suboffsets[i] >= 0)) {
40011 0 : PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
40012 : "indirect dimensions (axis %d)", i);
40013 0 : goto fail;
40014 : }
40015 : }
40016 0 : shape_tuple = PyTuple_New(ndim);
40017 0 : if (unlikely(!shape_tuple)) {
40018 0 : goto fail;
40019 : }
40020 : __Pyx_GOTREF(shape_tuple);
40021 0 : for(i = 0; i < ndim; i++) {
40022 0 : temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
40023 0 : if(unlikely(!temp_int)) {
40024 0 : goto fail;
40025 : } else {
40026 0 : PyTuple_SET_ITEM(shape_tuple, i, temp_int);
40027 0 : temp_int = NULL;
40028 : }
40029 : }
40030 0 : array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
40031 0 : if (unlikely(!array_obj)) {
40032 0 : goto fail;
40033 : }
40034 0 : __Pyx_GOTREF(array_obj);
40035 0 : memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
40036 : (PyObject *) array_obj, contig_flag,
40037 : dtype_is_object,
40038 0 : from_mvs->memview->typeinfo);
40039 0 : if (unlikely(!memview_obj))
40040 0 : goto fail;
40041 0 : if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
40042 0 : goto fail;
40043 0 : if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
40044 : dtype_is_object) < 0))
40045 0 : goto fail;
40046 0 : goto no_fail;
40047 0 : fail:
40048 0 : __Pyx_XDECREF(new_mvs.memview);
40049 0 : new_mvs.memview = NULL;
40050 0 : new_mvs.data = NULL;
40051 0 : no_fail:
40052 0 : __Pyx_XDECREF(shape_tuple);
40053 0 : __Pyx_XDECREF(temp_int);
40054 0 : __Pyx_XDECREF(array_obj);
40055 0 : __Pyx_RefNannyFinishContext();
40056 0 : return new_mvs;
40057 : }
40058 :
40059 : /* MemviewSliceInit */
40060 : static int
40061 75717 : __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
40062 : int ndim,
40063 : __Pyx_memviewslice *memviewslice,
40064 : int memview_is_new_reference)
40065 : {
40066 : __Pyx_RefNannyDeclarations
40067 75717 : int i, retval=-1;
40068 75717 : Py_buffer *buf = &memview->view;
40069 75717 : __Pyx_RefNannySetupContext("init_memviewslice", 0);
40070 75717 : if (unlikely(memviewslice->memview || memviewslice->data)) {
40071 0 : PyErr_SetString(PyExc_ValueError,
40072 : "memviewslice is already initialized!");
40073 0 : goto fail;
40074 : }
40075 75717 : if (buf->strides) {
40076 179704 : for (i = 0; i < ndim; i++) {
40077 103987 : memviewslice->strides[i] = buf->strides[i];
40078 : }
40079 : } else {
40080 0 : Py_ssize_t stride = buf->itemsize;
40081 0 : for (i = ndim - 1; i >= 0; i--) {
40082 0 : memviewslice->strides[i] = stride;
40083 0 : stride *= buf->shape[i];
40084 : }
40085 : }
40086 179704 : for (i = 0; i < ndim; i++) {
40087 103987 : memviewslice->shape[i] = buf->shape[i];
40088 103987 : if (buf->suboffsets) {
40089 0 : memviewslice->suboffsets[i] = buf->suboffsets[i];
40090 : } else {
40091 103987 : memviewslice->suboffsets[i] = -1;
40092 : }
40093 : }
40094 75717 : memviewslice->memview = memview;
40095 75717 : memviewslice->data = (char *)buf->buf;
40096 75717 : if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
40097 0 : Py_INCREF(memview);
40098 : }
40099 75717 : retval = 0;
40100 75717 : goto no_fail;
40101 0 : fail:
40102 0 : memviewslice->memview = 0;
40103 0 : memviewslice->data = 0;
40104 0 : retval = -1;
40105 75717 : no_fail:
40106 75717 : __Pyx_RefNannyFinishContext();
40107 75717 : return retval;
40108 : }
40109 : #ifndef Py_NO_RETURN
40110 : #define Py_NO_RETURN
40111 : #endif
40112 0 : static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
40113 0 : va_list vargs;
40114 0 : char msg[200];
40115 : #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
40116 0 : va_start(vargs, fmt);
40117 : #else
40118 : va_start(vargs);
40119 : #endif
40120 0 : vsnprintf(msg, 200, fmt, vargs);
40121 0 : va_end(vargs);
40122 0 : Py_FatalError(msg);
40123 : }
40124 : static CYTHON_INLINE int
40125 : __pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
40126 : PyThread_type_lock lock)
40127 : {
40128 : int result;
40129 : PyThread_acquire_lock(lock, 1);
40130 : result = (*acquisition_count)++;
40131 : PyThread_release_lock(lock);
40132 : return result;
40133 : }
40134 : static CYTHON_INLINE int
40135 : __pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
40136 : PyThread_type_lock lock)
40137 : {
40138 : int result;
40139 : PyThread_acquire_lock(lock, 1);
40140 : result = (*acquisition_count)--;
40141 : PyThread_release_lock(lock);
40142 : return result;
40143 : }
40144 : static CYTHON_INLINE void
40145 54626550 : __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
40146 : {
40147 54626550 : __pyx_nonatomic_int_type old_acquisition_count;
40148 54626550 : struct __pyx_memoryview_obj *memview = memslice->memview;
40149 54626550 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
40150 : return;
40151 : }
40152 54626550 : old_acquisition_count = __pyx_add_acquisition_count(memview);
40153 54626550 : if (unlikely(old_acquisition_count <= 0)) {
40154 0 : if (likely(old_acquisition_count == 0)) {
40155 0 : if (have_gil) {
40156 0 : Py_INCREF((PyObject *) memview);
40157 : } else {
40158 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
40159 0 : Py_INCREF((PyObject *) memview);
40160 0 : PyGILState_Release(_gilstate);
40161 : }
40162 : } else {
40163 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
40164 : old_acquisition_count+1, lineno);
40165 : }
40166 : }
40167 : }
40168 54703320 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
40169 : int have_gil, int lineno) {
40170 54703320 : __pyx_nonatomic_int_type old_acquisition_count;
40171 54703320 : struct __pyx_memoryview_obj *memview = memslice->memview;
40172 54703320 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
40173 1053 : memslice->memview = NULL;
40174 1053 : return;
40175 : }
40176 54702267 : old_acquisition_count = __pyx_sub_acquisition_count(memview);
40177 54702267 : memslice->data = NULL;
40178 54702267 : if (likely(old_acquisition_count > 1)) {
40179 54626550 : memslice->memview = NULL;
40180 75717 : } else if (likely(old_acquisition_count == 1)) {
40181 75717 : if (have_gil) {
40182 75717 : Py_CLEAR(memslice->memview);
40183 : } else {
40184 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
40185 0 : Py_CLEAR(memslice->memview);
40186 0 : PyGILState_Release(_gilstate);
40187 : }
40188 : } else {
40189 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
40190 : old_acquisition_count-1, lineno);
40191 : }
40192 : }
40193 :
40194 : /* CIntFromPy */
40195 107367 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
40196 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40197 107367 : #pragma GCC diagnostic push
40198 107367 : #pragma GCC diagnostic ignored "-Wconversion"
40199 : #endif
40200 107367 : const int neg_one = (int) -1, const_zero = (int) 0;
40201 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40202 107367 : #pragma GCC diagnostic pop
40203 : #endif
40204 107367 : const int is_unsigned = neg_one > const_zero;
40205 : #if PY_MAJOR_VERSION < 3
40206 : if (likely(PyInt_Check(x))) {
40207 : if ((sizeof(int) < sizeof(long))) {
40208 : __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
40209 : } else {
40210 : long val = PyInt_AS_LONG(x);
40211 : if (is_unsigned && unlikely(val < 0)) {
40212 : goto raise_neg_overflow;
40213 : }
40214 : return (int) val;
40215 : }
40216 : }
40217 : #endif
40218 107367 : if (unlikely(!PyLong_Check(x))) {
40219 159 : int val;
40220 159 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40221 159 : if (!tmp) return (int) -1;
40222 159 : val = __Pyx_PyInt_As_int(tmp);
40223 159 : Py_DECREF(tmp);
40224 159 : return val;
40225 : }
40226 107208 : if (is_unsigned) {
40227 : #if CYTHON_USE_PYLONG_INTERNALS
40228 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
40229 : goto raise_neg_overflow;
40230 : } else if (__Pyx_PyLong_IsCompact(x)) {
40231 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
40232 : } else {
40233 : const digit* digits = __Pyx_PyLong_Digits(x);
40234 : assert(__Pyx_PyLong_DigitCount(x) > 1);
40235 : switch (__Pyx_PyLong_DigitCount(x)) {
40236 : case 2:
40237 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
40238 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
40239 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40240 : } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
40241 : return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
40242 : }
40243 : }
40244 : break;
40245 : case 3:
40246 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
40247 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
40248 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40249 : } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
40250 : return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
40251 : }
40252 : }
40253 : break;
40254 : case 4:
40255 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
40256 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
40257 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40258 : } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
40259 : return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
40260 : }
40261 : }
40262 : break;
40263 : }
40264 : }
40265 : #endif
40266 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
40267 : if (unlikely(Py_SIZE(x) < 0)) {
40268 : goto raise_neg_overflow;
40269 : }
40270 : #else
40271 : {
40272 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40273 : if (unlikely(result < 0))
40274 : return (int) -1;
40275 : if (unlikely(result == 1))
40276 : goto raise_neg_overflow;
40277 : }
40278 : #endif
40279 : if ((sizeof(int) <= sizeof(unsigned long))) {
40280 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
40281 : #ifdef HAVE_LONG_LONG
40282 : } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
40283 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40284 : #endif
40285 : }
40286 : } else {
40287 : #if CYTHON_USE_PYLONG_INTERNALS
40288 107208 : if (__Pyx_PyLong_IsCompact(x)) {
40289 107208 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
40290 : } else {
40291 0 : const digit* digits = __Pyx_PyLong_Digits(x);
40292 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
40293 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
40294 0 : case -2:
40295 0 : if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
40296 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
40297 0 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40298 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
40299 : return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40300 : }
40301 : }
40302 : break;
40303 0 : case 2:
40304 0 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
40305 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
40306 0 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40307 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
40308 : return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40309 : }
40310 : }
40311 : break;
40312 : case -3:
40313 : if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
40314 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
40315 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40316 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
40317 : return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40318 : }
40319 : }
40320 : break;
40321 : case 3:
40322 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
40323 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
40324 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40325 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
40326 : return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40327 : }
40328 : }
40329 : break;
40330 : case -4:
40331 : if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
40332 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
40333 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40334 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
40335 : return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40336 : }
40337 : }
40338 : break;
40339 : case 4:
40340 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
40341 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
40342 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40343 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
40344 : return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
40345 : }
40346 : }
40347 : break;
40348 : }
40349 : }
40350 : #endif
40351 0 : if ((sizeof(int) <= sizeof(long))) {
40352 0 : __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
40353 : #ifdef HAVE_LONG_LONG
40354 : } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
40355 : __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
40356 : #endif
40357 : }
40358 : }
40359 : {
40360 : int val;
40361 : int ret = -1;
40362 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
40363 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
40364 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
40365 : if (unlikely(bytes_copied == -1)) {
40366 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
40367 : goto raise_overflow;
40368 : } else {
40369 : ret = 0;
40370 : }
40371 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
40372 : int one = 1; int is_little = (int)*(unsigned char *)&one;
40373 : unsigned char *bytes = (unsigned char *)&val;
40374 : ret = _PyLong_AsByteArray((PyLongObject *)x,
40375 : bytes, sizeof(val),
40376 : is_little, !is_unsigned);
40377 : #else
40378 : PyObject *v;
40379 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
40380 : int bits, remaining_bits, is_negative = 0;
40381 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
40382 : if (likely(PyLong_CheckExact(x))) {
40383 : v = __Pyx_NewRef(x);
40384 : } else {
40385 : v = PyNumber_Long(x);
40386 : if (unlikely(!v)) return (int) -1;
40387 : assert(PyLong_CheckExact(v));
40388 : }
40389 : {
40390 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
40391 : if (unlikely(result < 0)) {
40392 : Py_DECREF(v);
40393 : return (int) -1;
40394 : }
40395 : is_negative = result == 1;
40396 : }
40397 : if (is_unsigned && unlikely(is_negative)) {
40398 : Py_DECREF(v);
40399 : goto raise_neg_overflow;
40400 : } else if (is_negative) {
40401 : stepval = PyNumber_Invert(v);
40402 : Py_DECREF(v);
40403 : if (unlikely(!stepval))
40404 : return (int) -1;
40405 : } else {
40406 : stepval = v;
40407 : }
40408 : v = NULL;
40409 : val = (int) 0;
40410 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
40411 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
40412 : for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
40413 : PyObject *tmp, *digit;
40414 : long idigit;
40415 : digit = PyNumber_And(stepval, mask);
40416 : if (unlikely(!digit)) goto done;
40417 : idigit = PyLong_AsLong(digit);
40418 : Py_DECREF(digit);
40419 : if (unlikely(idigit < 0)) goto done;
40420 : val |= ((int) idigit) << bits;
40421 : tmp = PyNumber_Rshift(stepval, shift);
40422 : if (unlikely(!tmp)) goto done;
40423 : Py_DECREF(stepval); stepval = tmp;
40424 : }
40425 : Py_DECREF(shift); shift = NULL;
40426 : Py_DECREF(mask); mask = NULL;
40427 : {
40428 : long idigit = PyLong_AsLong(stepval);
40429 : if (unlikely(idigit < 0)) goto done;
40430 : remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
40431 : if (unlikely(idigit >= (1L << remaining_bits)))
40432 : goto raise_overflow;
40433 : val |= ((int) idigit) << bits;
40434 : }
40435 : if (!is_unsigned) {
40436 : if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
40437 : goto raise_overflow;
40438 : if (is_negative)
40439 : val = ~val;
40440 : }
40441 : ret = 0;
40442 : done:
40443 : Py_XDECREF(shift);
40444 : Py_XDECREF(mask);
40445 : Py_XDECREF(stepval);
40446 : #endif
40447 : if (unlikely(ret))
40448 : return (int) -1;
40449 : return val;
40450 : }
40451 0 : raise_overflow:
40452 0 : PyErr_SetString(PyExc_OverflowError,
40453 : "value too large to convert to int");
40454 0 : return (int) -1;
40455 : raise_neg_overflow:
40456 : PyErr_SetString(PyExc_OverflowError,
40457 : "can't convert negative value to int");
40458 : return (int) -1;
40459 : }
40460 :
40461 : /* CIntToPy */
40462 75834 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
40463 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40464 75834 : #pragma GCC diagnostic push
40465 75834 : #pragma GCC diagnostic ignored "-Wconversion"
40466 : #endif
40467 75834 : const int neg_one = (int) -1, const_zero = (int) 0;
40468 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40469 75834 : #pragma GCC diagnostic pop
40470 : #endif
40471 75834 : const int is_unsigned = neg_one > const_zero;
40472 75834 : if (is_unsigned) {
40473 : if (sizeof(int) < sizeof(long)) {
40474 : return PyInt_FromLong((long) value);
40475 : } else if (sizeof(int) <= sizeof(unsigned long)) {
40476 : return PyLong_FromUnsignedLong((unsigned long) value);
40477 : #ifdef HAVE_LONG_LONG
40478 : } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
40479 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
40480 : #endif
40481 : }
40482 : } else {
40483 75834 : if (sizeof(int) <= sizeof(long)) {
40484 75834 : return PyInt_FromLong((long) value);
40485 : #ifdef HAVE_LONG_LONG
40486 : } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
40487 : return PyLong_FromLongLong((PY_LONG_LONG) value);
40488 : #endif
40489 : }
40490 : }
40491 : {
40492 : unsigned char *bytes = (unsigned char *)&value;
40493 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
40494 : if (is_unsigned) {
40495 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
40496 : } else {
40497 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
40498 : }
40499 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
40500 : int one = 1; int little = (int)*(unsigned char *)&one;
40501 : return _PyLong_FromByteArray(bytes, sizeof(int),
40502 : little, !is_unsigned);
40503 : #else
40504 : int one = 1; int little = (int)*(unsigned char *)&one;
40505 : PyObject *from_bytes, *result = NULL;
40506 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
40507 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
40508 : if (!from_bytes) return NULL;
40509 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
40510 : if (!py_bytes) goto limited_bad;
40511 : order_str = PyUnicode_FromString(little ? "little" : "big");
40512 : if (!order_str) goto limited_bad;
40513 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
40514 : if (!arg_tuple) goto limited_bad;
40515 : if (!is_unsigned) {
40516 : kwds = PyDict_New();
40517 : if (!kwds) goto limited_bad;
40518 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
40519 : }
40520 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
40521 : limited_bad:
40522 : Py_XDECREF(kwds);
40523 : Py_XDECREF(arg_tuple);
40524 : Py_XDECREF(order_str);
40525 : Py_XDECREF(py_bytes);
40526 : Py_XDECREF(from_bytes);
40527 : return result;
40528 : #endif
40529 : }
40530 : }
40531 :
40532 : /* CIntFromPy */
40533 201 : static CYTHON_INLINE npy_intp __Pyx_PyInt_As_npy_intp(PyObject *x) {
40534 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40535 201 : #pragma GCC diagnostic push
40536 201 : #pragma GCC diagnostic ignored "-Wconversion"
40537 : #endif
40538 201 : const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
40539 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40540 201 : #pragma GCC diagnostic pop
40541 : #endif
40542 201 : const int is_unsigned = neg_one > const_zero;
40543 : #if PY_MAJOR_VERSION < 3
40544 : if (likely(PyInt_Check(x))) {
40545 : if ((sizeof(npy_intp) < sizeof(long))) {
40546 : __PYX_VERIFY_RETURN_INT(npy_intp, long, PyInt_AS_LONG(x))
40547 : } else {
40548 : long val = PyInt_AS_LONG(x);
40549 : if (is_unsigned && unlikely(val < 0)) {
40550 : goto raise_neg_overflow;
40551 : }
40552 : return (npy_intp) val;
40553 : }
40554 : }
40555 : #endif
40556 201 : if (unlikely(!PyLong_Check(x))) {
40557 0 : npy_intp val;
40558 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40559 0 : if (!tmp) return (npy_intp) -1;
40560 0 : val = __Pyx_PyInt_As_npy_intp(tmp);
40561 0 : Py_DECREF(tmp);
40562 0 : return val;
40563 : }
40564 201 : if (is_unsigned) {
40565 : #if CYTHON_USE_PYLONG_INTERNALS
40566 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
40567 : goto raise_neg_overflow;
40568 : } else if (__Pyx_PyLong_IsCompact(x)) {
40569 : __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
40570 : } else {
40571 : const digit* digits = __Pyx_PyLong_Digits(x);
40572 : assert(__Pyx_PyLong_DigitCount(x) > 1);
40573 : switch (__Pyx_PyLong_DigitCount(x)) {
40574 : case 2:
40575 : if ((8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
40576 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
40577 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40578 : } else if ((8 * sizeof(npy_intp) >= 2 * PyLong_SHIFT)) {
40579 : return (npy_intp) (((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
40580 : }
40581 : }
40582 : break;
40583 : case 3:
40584 : if ((8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
40585 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
40586 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40587 : } else if ((8 * sizeof(npy_intp) >= 3 * PyLong_SHIFT)) {
40588 : return (npy_intp) (((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
40589 : }
40590 : }
40591 : break;
40592 : case 4:
40593 : if ((8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
40594 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
40595 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40596 : } else if ((8 * sizeof(npy_intp) >= 4 * PyLong_SHIFT)) {
40597 : return (npy_intp) (((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
40598 : }
40599 : }
40600 : break;
40601 : }
40602 : }
40603 : #endif
40604 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
40605 : if (unlikely(Py_SIZE(x) < 0)) {
40606 : goto raise_neg_overflow;
40607 : }
40608 : #else
40609 : {
40610 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
40611 : if (unlikely(result < 0))
40612 : return (npy_intp) -1;
40613 : if (unlikely(result == 1))
40614 : goto raise_neg_overflow;
40615 : }
40616 : #endif
40617 : if ((sizeof(npy_intp) <= sizeof(unsigned long))) {
40618 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned long, PyLong_AsUnsignedLong(x))
40619 : #ifdef HAVE_LONG_LONG
40620 : } else if ((sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG))) {
40621 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
40622 : #endif
40623 : }
40624 : } else {
40625 : #if CYTHON_USE_PYLONG_INTERNALS
40626 201 : if (__Pyx_PyLong_IsCompact(x)) {
40627 201 : __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
40628 : } else {
40629 0 : const digit* digits = __Pyx_PyLong_Digits(x);
40630 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
40631 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
40632 0 : case -2:
40633 0 : if ((8 * sizeof(npy_intp) - 1 > 1 * PyLong_SHIFT)) {
40634 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
40635 0 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40636 : } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
40637 : return (npy_intp) (((npy_intp)-1)*(((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
40638 : }
40639 : }
40640 : break;
40641 0 : case 2:
40642 0 : if ((8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
40643 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
40644 0 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40645 : } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
40646 : return (npy_intp) ((((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
40647 : }
40648 : }
40649 : break;
40650 : case -3:
40651 : if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
40652 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
40653 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40654 : } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
40655 : return (npy_intp) (((npy_intp)-1)*(((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
40656 : }
40657 : }
40658 : break;
40659 : case 3:
40660 : if ((8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
40661 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
40662 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40663 : } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
40664 : return (npy_intp) ((((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
40665 : }
40666 : }
40667 : break;
40668 : case -4:
40669 : if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
40670 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
40671 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40672 : } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
40673 : return (npy_intp) (((npy_intp)-1)*(((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
40674 : }
40675 : }
40676 : break;
40677 : case 4:
40678 : if ((8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
40679 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
40680 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40681 : } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
40682 : return (npy_intp) ((((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
40683 : }
40684 : }
40685 : break;
40686 : }
40687 : }
40688 : #endif
40689 0 : if ((sizeof(npy_intp) <= sizeof(long))) {
40690 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, long, PyLong_AsLong(x))
40691 : #ifdef HAVE_LONG_LONG
40692 : } else if ((sizeof(npy_intp) <= sizeof(PY_LONG_LONG))) {
40693 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, PY_LONG_LONG, PyLong_AsLongLong(x))
40694 : #endif
40695 : }
40696 : }
40697 : {
40698 : npy_intp val;
40699 : int ret = -1;
40700 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
40701 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
40702 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
40703 : if (unlikely(bytes_copied == -1)) {
40704 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
40705 : goto raise_overflow;
40706 : } else {
40707 : ret = 0;
40708 : }
40709 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
40710 : int one = 1; int is_little = (int)*(unsigned char *)&one;
40711 : unsigned char *bytes = (unsigned char *)&val;
40712 : ret = _PyLong_AsByteArray((PyLongObject *)x,
40713 : bytes, sizeof(val),
40714 : is_little, !is_unsigned);
40715 : #else
40716 : PyObject *v;
40717 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
40718 : int bits, remaining_bits, is_negative = 0;
40719 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
40720 : if (likely(PyLong_CheckExact(x))) {
40721 : v = __Pyx_NewRef(x);
40722 : } else {
40723 : v = PyNumber_Long(x);
40724 : if (unlikely(!v)) return (npy_intp) -1;
40725 : assert(PyLong_CheckExact(v));
40726 : }
40727 : {
40728 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
40729 : if (unlikely(result < 0)) {
40730 : Py_DECREF(v);
40731 : return (npy_intp) -1;
40732 : }
40733 : is_negative = result == 1;
40734 : }
40735 : if (is_unsigned && unlikely(is_negative)) {
40736 : Py_DECREF(v);
40737 : goto raise_neg_overflow;
40738 : } else if (is_negative) {
40739 : stepval = PyNumber_Invert(v);
40740 : Py_DECREF(v);
40741 : if (unlikely(!stepval))
40742 : return (npy_intp) -1;
40743 : } else {
40744 : stepval = v;
40745 : }
40746 : v = NULL;
40747 : val = (npy_intp) 0;
40748 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
40749 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
40750 : for (bits = 0; bits < (int) sizeof(npy_intp) * 8 - chunk_size; bits += chunk_size) {
40751 : PyObject *tmp, *digit;
40752 : long idigit;
40753 : digit = PyNumber_And(stepval, mask);
40754 : if (unlikely(!digit)) goto done;
40755 : idigit = PyLong_AsLong(digit);
40756 : Py_DECREF(digit);
40757 : if (unlikely(idigit < 0)) goto done;
40758 : val |= ((npy_intp) idigit) << bits;
40759 : tmp = PyNumber_Rshift(stepval, shift);
40760 : if (unlikely(!tmp)) goto done;
40761 : Py_DECREF(stepval); stepval = tmp;
40762 : }
40763 : Py_DECREF(shift); shift = NULL;
40764 : Py_DECREF(mask); mask = NULL;
40765 : {
40766 : long idigit = PyLong_AsLong(stepval);
40767 : if (unlikely(idigit < 0)) goto done;
40768 : remaining_bits = ((int) sizeof(npy_intp) * 8) - bits - (is_unsigned ? 0 : 1);
40769 : if (unlikely(idigit >= (1L << remaining_bits)))
40770 : goto raise_overflow;
40771 : val |= ((npy_intp) idigit) << bits;
40772 : }
40773 : if (!is_unsigned) {
40774 : if (unlikely(val & (((npy_intp) 1) << (sizeof(npy_intp) * 8 - 1))))
40775 : goto raise_overflow;
40776 : if (is_negative)
40777 : val = ~val;
40778 : }
40779 : ret = 0;
40780 : done:
40781 : Py_XDECREF(shift);
40782 : Py_XDECREF(mask);
40783 : Py_XDECREF(stepval);
40784 : #endif
40785 : if (unlikely(ret))
40786 : return (npy_intp) -1;
40787 : return val;
40788 : }
40789 : raise_overflow:
40790 : PyErr_SetString(PyExc_OverflowError,
40791 : "value too large to convert to npy_intp");
40792 : return (npy_intp) -1;
40793 : raise_neg_overflow:
40794 : PyErr_SetString(PyExc_OverflowError,
40795 : "can't convert negative value to npy_intp");
40796 : return (npy_intp) -1;
40797 : }
40798 :
40799 : /* CIntToPy */
40800 14709 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
40801 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40802 14709 : #pragma GCC diagnostic push
40803 14709 : #pragma GCC diagnostic ignored "-Wconversion"
40804 : #endif
40805 14709 : const long neg_one = (long) -1, const_zero = (long) 0;
40806 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40807 14709 : #pragma GCC diagnostic pop
40808 : #endif
40809 14709 : const int is_unsigned = neg_one > const_zero;
40810 14709 : if (is_unsigned) {
40811 : if (sizeof(long) < sizeof(long)) {
40812 : return PyInt_FromLong((long) value);
40813 : } else if (sizeof(long) <= sizeof(unsigned long)) {
40814 : return PyLong_FromUnsignedLong((unsigned long) value);
40815 : #ifdef HAVE_LONG_LONG
40816 : } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
40817 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
40818 : #endif
40819 : }
40820 : } else {
40821 14709 : if (sizeof(long) <= sizeof(long)) {
40822 14709 : return PyInt_FromLong((long) value);
40823 : #ifdef HAVE_LONG_LONG
40824 : } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
40825 : return PyLong_FromLongLong((PY_LONG_LONG) value);
40826 : #endif
40827 : }
40828 : }
40829 : {
40830 : unsigned char *bytes = (unsigned char *)&value;
40831 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
40832 : if (is_unsigned) {
40833 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
40834 : } else {
40835 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
40836 : }
40837 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
40838 : int one = 1; int little = (int)*(unsigned char *)&one;
40839 : return _PyLong_FromByteArray(bytes, sizeof(long),
40840 : little, !is_unsigned);
40841 : #else
40842 : int one = 1; int little = (int)*(unsigned char *)&one;
40843 : PyObject *from_bytes, *result = NULL;
40844 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
40845 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
40846 : if (!from_bytes) return NULL;
40847 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
40848 : if (!py_bytes) goto limited_bad;
40849 : order_str = PyUnicode_FromString(little ? "little" : "big");
40850 : if (!order_str) goto limited_bad;
40851 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
40852 : if (!arg_tuple) goto limited_bad;
40853 : if (!is_unsigned) {
40854 : kwds = PyDict_New();
40855 : if (!kwds) goto limited_bad;
40856 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
40857 : }
40858 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
40859 : limited_bad:
40860 : Py_XDECREF(kwds);
40861 : Py_XDECREF(arg_tuple);
40862 : Py_XDECREF(order_str);
40863 : Py_XDECREF(py_bytes);
40864 : Py_XDECREF(from_bytes);
40865 : return result;
40866 : #endif
40867 : }
40868 : }
40869 :
40870 : /* CIntToPy */
40871 1617 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value) {
40872 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40873 1617 : #pragma GCC diagnostic push
40874 1617 : #pragma GCC diagnostic ignored "-Wconversion"
40875 : #endif
40876 1617 : const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
40877 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40878 1617 : #pragma GCC diagnostic pop
40879 : #endif
40880 1617 : const int is_unsigned = neg_one > const_zero;
40881 1617 : if (is_unsigned) {
40882 : if (sizeof(npy_intp) < sizeof(long)) {
40883 : return PyInt_FromLong((long) value);
40884 : } else if (sizeof(npy_intp) <= sizeof(unsigned long)) {
40885 : return PyLong_FromUnsignedLong((unsigned long) value);
40886 : #ifdef HAVE_LONG_LONG
40887 : } else if (sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG)) {
40888 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
40889 : #endif
40890 : }
40891 : } else {
40892 1617 : if (sizeof(npy_intp) <= sizeof(long)) {
40893 1617 : return PyInt_FromLong((long) value);
40894 : #ifdef HAVE_LONG_LONG
40895 : } else if (sizeof(npy_intp) <= sizeof(PY_LONG_LONG)) {
40896 : return PyLong_FromLongLong((PY_LONG_LONG) value);
40897 : #endif
40898 : }
40899 : }
40900 : {
40901 : unsigned char *bytes = (unsigned char *)&value;
40902 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
40903 : if (is_unsigned) {
40904 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
40905 : } else {
40906 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
40907 : }
40908 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
40909 : int one = 1; int little = (int)*(unsigned char *)&one;
40910 : return _PyLong_FromByteArray(bytes, sizeof(npy_intp),
40911 : little, !is_unsigned);
40912 : #else
40913 : int one = 1; int little = (int)*(unsigned char *)&one;
40914 : PyObject *from_bytes, *result = NULL;
40915 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
40916 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
40917 : if (!from_bytes) return NULL;
40918 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_intp));
40919 : if (!py_bytes) goto limited_bad;
40920 : order_str = PyUnicode_FromString(little ? "little" : "big");
40921 : if (!order_str) goto limited_bad;
40922 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
40923 : if (!arg_tuple) goto limited_bad;
40924 : if (!is_unsigned) {
40925 : kwds = PyDict_New();
40926 : if (!kwds) goto limited_bad;
40927 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
40928 : }
40929 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
40930 : limited_bad:
40931 : Py_XDECREF(kwds);
40932 : Py_XDECREF(arg_tuple);
40933 : Py_XDECREF(order_str);
40934 : Py_XDECREF(py_bytes);
40935 : Py_XDECREF(from_bytes);
40936 : return result;
40937 : #endif
40938 : }
40939 : }
40940 :
40941 : /* CIntFromPy */
40942 0 : static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
40943 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40944 0 : #pragma GCC diagnostic push
40945 0 : #pragma GCC diagnostic ignored "-Wconversion"
40946 : #endif
40947 0 : const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
40948 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
40949 0 : #pragma GCC diagnostic pop
40950 : #endif
40951 0 : const int is_unsigned = neg_one > const_zero;
40952 : #if PY_MAJOR_VERSION < 3
40953 : if (likely(PyInt_Check(x))) {
40954 : if ((sizeof(npy_int32) < sizeof(long))) {
40955 : __PYX_VERIFY_RETURN_INT(npy_int32, long, PyInt_AS_LONG(x))
40956 : } else {
40957 : long val = PyInt_AS_LONG(x);
40958 : if (is_unsigned && unlikely(val < 0)) {
40959 : goto raise_neg_overflow;
40960 : }
40961 : return (npy_int32) val;
40962 : }
40963 : }
40964 : #endif
40965 0 : if (unlikely(!PyLong_Check(x))) {
40966 0 : npy_int32 val;
40967 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
40968 0 : if (!tmp) return (npy_int32) -1;
40969 0 : val = __Pyx_PyInt_As_npy_int32(tmp);
40970 0 : Py_DECREF(tmp);
40971 0 : return val;
40972 : }
40973 0 : if (is_unsigned) {
40974 : #if CYTHON_USE_PYLONG_INTERNALS
40975 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
40976 : goto raise_neg_overflow;
40977 : } else if (__Pyx_PyLong_IsCompact(x)) {
40978 : __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
40979 : } else {
40980 : const digit* digits = __Pyx_PyLong_Digits(x);
40981 : assert(__Pyx_PyLong_DigitCount(x) > 1);
40982 : switch (__Pyx_PyLong_DigitCount(x)) {
40983 : case 2:
40984 : if ((8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
40985 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
40986 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40987 : } else if ((8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT)) {
40988 : return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
40989 : }
40990 : }
40991 : break;
40992 : case 3:
40993 : if ((8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
40994 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
40995 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
40996 : } else if ((8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT)) {
40997 : return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
40998 : }
40999 : }
41000 : break;
41001 : case 4:
41002 : if ((8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
41003 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41004 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41005 : } else if ((8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT)) {
41006 : return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
41007 : }
41008 : }
41009 : break;
41010 : }
41011 : }
41012 : #endif
41013 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
41014 : if (unlikely(Py_SIZE(x) < 0)) {
41015 : goto raise_neg_overflow;
41016 : }
41017 : #else
41018 : {
41019 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41020 : if (unlikely(result < 0))
41021 : return (npy_int32) -1;
41022 : if (unlikely(result == 1))
41023 : goto raise_neg_overflow;
41024 : }
41025 : #endif
41026 : if ((sizeof(npy_int32) <= sizeof(unsigned long))) {
41027 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
41028 : #ifdef HAVE_LONG_LONG
41029 : } else if ((sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG))) {
41030 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41031 : #endif
41032 : }
41033 : } else {
41034 : #if CYTHON_USE_PYLONG_INTERNALS
41035 0 : if (__Pyx_PyLong_IsCompact(x)) {
41036 0 : __PYX_VERIFY_RETURN_INT(npy_int32, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
41037 : } else {
41038 0 : const digit* digits = __Pyx_PyLong_Digits(x);
41039 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
41040 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
41041 0 : case -2:
41042 0 : if ((8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT)) {
41043 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41044 0 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41045 : } else if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
41046 : return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
41047 : }
41048 : }
41049 : break;
41050 0 : case 2:
41051 0 : if ((8 * sizeof(npy_int32) > 1 * PyLong_SHIFT)) {
41052 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41053 0 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41054 : } else if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
41055 : return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
41056 : }
41057 : }
41058 : break;
41059 : case -3:
41060 : if ((8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT)) {
41061 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41062 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41063 : } else if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
41064 : return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
41065 : }
41066 : }
41067 : break;
41068 : case 3:
41069 : if ((8 * sizeof(npy_int32) > 2 * PyLong_SHIFT)) {
41070 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41071 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41072 : } else if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
41073 : return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
41074 : }
41075 : }
41076 : break;
41077 : case -4:
41078 : if ((8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT)) {
41079 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41080 : __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41081 : } else if ((8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
41082 : return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
41083 : }
41084 : }
41085 : break;
41086 : case 4:
41087 : if ((8 * sizeof(npy_int32) > 3 * PyLong_SHIFT)) {
41088 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41089 : __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41090 : } else if ((8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT)) {
41091 : return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
41092 : }
41093 : }
41094 : break;
41095 : }
41096 : }
41097 : #endif
41098 0 : if ((sizeof(npy_int32) <= sizeof(long))) {
41099 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
41100 : #ifdef HAVE_LONG_LONG
41101 : } else if ((sizeof(npy_int32) <= sizeof(PY_LONG_LONG))) {
41102 : __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
41103 : #endif
41104 : }
41105 : }
41106 : {
41107 : npy_int32 val;
41108 : int ret = -1;
41109 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
41110 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
41111 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
41112 : if (unlikely(bytes_copied == -1)) {
41113 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
41114 : goto raise_overflow;
41115 : } else {
41116 : ret = 0;
41117 : }
41118 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
41119 : int one = 1; int is_little = (int)*(unsigned char *)&one;
41120 : unsigned char *bytes = (unsigned char *)&val;
41121 : ret = _PyLong_AsByteArray((PyLongObject *)x,
41122 : bytes, sizeof(val),
41123 : is_little, !is_unsigned);
41124 : #else
41125 : PyObject *v;
41126 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
41127 : int bits, remaining_bits, is_negative = 0;
41128 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
41129 : if (likely(PyLong_CheckExact(x))) {
41130 : v = __Pyx_NewRef(x);
41131 : } else {
41132 : v = PyNumber_Long(x);
41133 : if (unlikely(!v)) return (npy_int32) -1;
41134 : assert(PyLong_CheckExact(v));
41135 : }
41136 : {
41137 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
41138 : if (unlikely(result < 0)) {
41139 : Py_DECREF(v);
41140 : return (npy_int32) -1;
41141 : }
41142 : is_negative = result == 1;
41143 : }
41144 : if (is_unsigned && unlikely(is_negative)) {
41145 : Py_DECREF(v);
41146 : goto raise_neg_overflow;
41147 : } else if (is_negative) {
41148 : stepval = PyNumber_Invert(v);
41149 : Py_DECREF(v);
41150 : if (unlikely(!stepval))
41151 : return (npy_int32) -1;
41152 : } else {
41153 : stepval = v;
41154 : }
41155 : v = NULL;
41156 : val = (npy_int32) 0;
41157 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
41158 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
41159 : for (bits = 0; bits < (int) sizeof(npy_int32) * 8 - chunk_size; bits += chunk_size) {
41160 : PyObject *tmp, *digit;
41161 : long idigit;
41162 : digit = PyNumber_And(stepval, mask);
41163 : if (unlikely(!digit)) goto done;
41164 : idigit = PyLong_AsLong(digit);
41165 : Py_DECREF(digit);
41166 : if (unlikely(idigit < 0)) goto done;
41167 : val |= ((npy_int32) idigit) << bits;
41168 : tmp = PyNumber_Rshift(stepval, shift);
41169 : if (unlikely(!tmp)) goto done;
41170 : Py_DECREF(stepval); stepval = tmp;
41171 : }
41172 : Py_DECREF(shift); shift = NULL;
41173 : Py_DECREF(mask); mask = NULL;
41174 : {
41175 : long idigit = PyLong_AsLong(stepval);
41176 : if (unlikely(idigit < 0)) goto done;
41177 : remaining_bits = ((int) sizeof(npy_int32) * 8) - bits - (is_unsigned ? 0 : 1);
41178 : if (unlikely(idigit >= (1L << remaining_bits)))
41179 : goto raise_overflow;
41180 : val |= ((npy_int32) idigit) << bits;
41181 : }
41182 : if (!is_unsigned) {
41183 : if (unlikely(val & (((npy_int32) 1) << (sizeof(npy_int32) * 8 - 1))))
41184 : goto raise_overflow;
41185 : if (is_negative)
41186 : val = ~val;
41187 : }
41188 : ret = 0;
41189 : done:
41190 : Py_XDECREF(shift);
41191 : Py_XDECREF(mask);
41192 : Py_XDECREF(stepval);
41193 : #endif
41194 : if (unlikely(ret))
41195 : return (npy_int32) -1;
41196 : return val;
41197 : }
41198 0 : raise_overflow:
41199 0 : PyErr_SetString(PyExc_OverflowError,
41200 : "value too large to convert to npy_int32");
41201 0 : return (npy_int32) -1;
41202 : raise_neg_overflow:
41203 : PyErr_SetString(PyExc_OverflowError,
41204 : "can't convert negative value to npy_int32");
41205 : return (npy_int32) -1;
41206 : }
41207 :
41208 : /* CIntToPy */
41209 2142 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int32(npy_int32 value) {
41210 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41211 2142 : #pragma GCC diagnostic push
41212 2142 : #pragma GCC diagnostic ignored "-Wconversion"
41213 : #endif
41214 2142 : const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 0;
41215 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41216 2142 : #pragma GCC diagnostic pop
41217 : #endif
41218 2142 : const int is_unsigned = neg_one > const_zero;
41219 2142 : if (is_unsigned) {
41220 : if (sizeof(npy_int32) < sizeof(long)) {
41221 : return PyInt_FromLong((long) value);
41222 : } else if (sizeof(npy_int32) <= sizeof(unsigned long)) {
41223 : return PyLong_FromUnsignedLong((unsigned long) value);
41224 : #ifdef HAVE_LONG_LONG
41225 : } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
41226 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
41227 : #endif
41228 : }
41229 : } else {
41230 2142 : if (sizeof(npy_int32) <= sizeof(long)) {
41231 2142 : return PyInt_FromLong((long) value);
41232 : #ifdef HAVE_LONG_LONG
41233 : } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
41234 : return PyLong_FromLongLong((PY_LONG_LONG) value);
41235 : #endif
41236 : }
41237 : }
41238 : {
41239 : unsigned char *bytes = (unsigned char *)&value;
41240 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
41241 : if (is_unsigned) {
41242 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
41243 : } else {
41244 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
41245 : }
41246 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
41247 : int one = 1; int little = (int)*(unsigned char *)&one;
41248 : return _PyLong_FromByteArray(bytes, sizeof(npy_int32),
41249 : little, !is_unsigned);
41250 : #else
41251 : int one = 1; int little = (int)*(unsigned char *)&one;
41252 : PyObject *from_bytes, *result = NULL;
41253 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
41254 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
41255 : if (!from_bytes) return NULL;
41256 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int32));
41257 : if (!py_bytes) goto limited_bad;
41258 : order_str = PyUnicode_FromString(little ? "little" : "big");
41259 : if (!order_str) goto limited_bad;
41260 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
41261 : if (!arg_tuple) goto limited_bad;
41262 : if (!is_unsigned) {
41263 : kwds = PyDict_New();
41264 : if (!kwds) goto limited_bad;
41265 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
41266 : }
41267 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
41268 : limited_bad:
41269 : Py_XDECREF(kwds);
41270 : Py_XDECREF(arg_tuple);
41271 : Py_XDECREF(order_str);
41272 : Py_XDECREF(py_bytes);
41273 : Py_XDECREF(from_bytes);
41274 : return result;
41275 : #endif
41276 : }
41277 : }
41278 :
41279 : /* CIntFromPy */
41280 0 : static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
41281 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41282 0 : #pragma GCC diagnostic push
41283 0 : #pragma GCC diagnostic ignored "-Wconversion"
41284 : #endif
41285 0 : const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
41286 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41287 0 : #pragma GCC diagnostic pop
41288 : #endif
41289 0 : const int is_unsigned = neg_one > const_zero;
41290 : #if PY_MAJOR_VERSION < 3
41291 : if (likely(PyInt_Check(x))) {
41292 : if ((sizeof(npy_int64) < sizeof(long))) {
41293 : __PYX_VERIFY_RETURN_INT(npy_int64, long, PyInt_AS_LONG(x))
41294 : } else {
41295 : long val = PyInt_AS_LONG(x);
41296 : if (is_unsigned && unlikely(val < 0)) {
41297 : goto raise_neg_overflow;
41298 : }
41299 : return (npy_int64) val;
41300 : }
41301 : }
41302 : #endif
41303 0 : if (unlikely(!PyLong_Check(x))) {
41304 0 : npy_int64 val;
41305 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41306 0 : if (!tmp) return (npy_int64) -1;
41307 0 : val = __Pyx_PyInt_As_npy_int64(tmp);
41308 0 : Py_DECREF(tmp);
41309 0 : return val;
41310 : }
41311 0 : if (is_unsigned) {
41312 : #if CYTHON_USE_PYLONG_INTERNALS
41313 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
41314 : goto raise_neg_overflow;
41315 : } else if (__Pyx_PyLong_IsCompact(x)) {
41316 : __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
41317 : } else {
41318 : const digit* digits = __Pyx_PyLong_Digits(x);
41319 : assert(__Pyx_PyLong_DigitCount(x) > 1);
41320 : switch (__Pyx_PyLong_DigitCount(x)) {
41321 : case 2:
41322 : if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) {
41323 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41324 : __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41325 : } else if ((8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT)) {
41326 : return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
41327 : }
41328 : }
41329 : break;
41330 : case 3:
41331 : if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) {
41332 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41333 : __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41334 : } else if ((8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT)) {
41335 : return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
41336 : }
41337 : }
41338 : break;
41339 : case 4:
41340 : if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) {
41341 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41342 : __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41343 : } else if ((8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT)) {
41344 : return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
41345 : }
41346 : }
41347 : break;
41348 : }
41349 : }
41350 : #endif
41351 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
41352 : if (unlikely(Py_SIZE(x) < 0)) {
41353 : goto raise_neg_overflow;
41354 : }
41355 : #else
41356 : {
41357 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41358 : if (unlikely(result < 0))
41359 : return (npy_int64) -1;
41360 : if (unlikely(result == 1))
41361 : goto raise_neg_overflow;
41362 : }
41363 : #endif
41364 : if ((sizeof(npy_int64) <= sizeof(unsigned long))) {
41365 : __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
41366 : #ifdef HAVE_LONG_LONG
41367 : } else if ((sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG))) {
41368 : __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41369 : #endif
41370 : }
41371 : } else {
41372 : #if CYTHON_USE_PYLONG_INTERNALS
41373 0 : if (__Pyx_PyLong_IsCompact(x)) {
41374 0 : __PYX_VERIFY_RETURN_INT(npy_int64, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
41375 : } else {
41376 0 : const digit* digits = __Pyx_PyLong_Digits(x);
41377 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
41378 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
41379 0 : case -2:
41380 0 : if ((8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT)) {
41381 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41382 0 : __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41383 : } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
41384 : return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
41385 : }
41386 : }
41387 : break;
41388 0 : case 2:
41389 0 : if ((8 * sizeof(npy_int64) > 1 * PyLong_SHIFT)) {
41390 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41391 0 : __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41392 : } else if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
41393 : return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
41394 : }
41395 : }
41396 : break;
41397 : case -3:
41398 : if ((8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT)) {
41399 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41400 : __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41401 : } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
41402 : return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
41403 : }
41404 : }
41405 : break;
41406 : case 3:
41407 : if ((8 * sizeof(npy_int64) > 2 * PyLong_SHIFT)) {
41408 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41409 : __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41410 : } else if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
41411 : return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
41412 : }
41413 : }
41414 : break;
41415 : case -4:
41416 : if ((8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT)) {
41417 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41418 : __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41419 : } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) {
41420 : return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
41421 : }
41422 : }
41423 : break;
41424 : case 4:
41425 : if ((8 * sizeof(npy_int64) > 3 * PyLong_SHIFT)) {
41426 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41427 : __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41428 : } else if ((8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT)) {
41429 : return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
41430 : }
41431 : }
41432 : break;
41433 : }
41434 : }
41435 : #endif
41436 0 : if ((sizeof(npy_int64) <= sizeof(long))) {
41437 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
41438 : #ifdef HAVE_LONG_LONG
41439 : } else if ((sizeof(npy_int64) <= sizeof(PY_LONG_LONG))) {
41440 : __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
41441 : #endif
41442 : }
41443 : }
41444 : {
41445 : npy_int64 val;
41446 : int ret = -1;
41447 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
41448 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
41449 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
41450 : if (unlikely(bytes_copied == -1)) {
41451 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
41452 : goto raise_overflow;
41453 : } else {
41454 : ret = 0;
41455 : }
41456 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
41457 : int one = 1; int is_little = (int)*(unsigned char *)&one;
41458 : unsigned char *bytes = (unsigned char *)&val;
41459 : ret = _PyLong_AsByteArray((PyLongObject *)x,
41460 : bytes, sizeof(val),
41461 : is_little, !is_unsigned);
41462 : #else
41463 : PyObject *v;
41464 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
41465 : int bits, remaining_bits, is_negative = 0;
41466 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
41467 : if (likely(PyLong_CheckExact(x))) {
41468 : v = __Pyx_NewRef(x);
41469 : } else {
41470 : v = PyNumber_Long(x);
41471 : if (unlikely(!v)) return (npy_int64) -1;
41472 : assert(PyLong_CheckExact(v));
41473 : }
41474 : {
41475 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
41476 : if (unlikely(result < 0)) {
41477 : Py_DECREF(v);
41478 : return (npy_int64) -1;
41479 : }
41480 : is_negative = result == 1;
41481 : }
41482 : if (is_unsigned && unlikely(is_negative)) {
41483 : Py_DECREF(v);
41484 : goto raise_neg_overflow;
41485 : } else if (is_negative) {
41486 : stepval = PyNumber_Invert(v);
41487 : Py_DECREF(v);
41488 : if (unlikely(!stepval))
41489 : return (npy_int64) -1;
41490 : } else {
41491 : stepval = v;
41492 : }
41493 : v = NULL;
41494 : val = (npy_int64) 0;
41495 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
41496 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
41497 : for (bits = 0; bits < (int) sizeof(npy_int64) * 8 - chunk_size; bits += chunk_size) {
41498 : PyObject *tmp, *digit;
41499 : long idigit;
41500 : digit = PyNumber_And(stepval, mask);
41501 : if (unlikely(!digit)) goto done;
41502 : idigit = PyLong_AsLong(digit);
41503 : Py_DECREF(digit);
41504 : if (unlikely(idigit < 0)) goto done;
41505 : val |= ((npy_int64) idigit) << bits;
41506 : tmp = PyNumber_Rshift(stepval, shift);
41507 : if (unlikely(!tmp)) goto done;
41508 : Py_DECREF(stepval); stepval = tmp;
41509 : }
41510 : Py_DECREF(shift); shift = NULL;
41511 : Py_DECREF(mask); mask = NULL;
41512 : {
41513 : long idigit = PyLong_AsLong(stepval);
41514 : if (unlikely(idigit < 0)) goto done;
41515 : remaining_bits = ((int) sizeof(npy_int64) * 8) - bits - (is_unsigned ? 0 : 1);
41516 : if (unlikely(idigit >= (1L << remaining_bits)))
41517 : goto raise_overflow;
41518 : val |= ((npy_int64) idigit) << bits;
41519 : }
41520 : if (!is_unsigned) {
41521 : if (unlikely(val & (((npy_int64) 1) << (sizeof(npy_int64) * 8 - 1))))
41522 : goto raise_overflow;
41523 : if (is_negative)
41524 : val = ~val;
41525 : }
41526 : ret = 0;
41527 : done:
41528 : Py_XDECREF(shift);
41529 : Py_XDECREF(mask);
41530 : Py_XDECREF(stepval);
41531 : #endif
41532 : if (unlikely(ret))
41533 : return (npy_int64) -1;
41534 : return val;
41535 : }
41536 : raise_overflow:
41537 : PyErr_SetString(PyExc_OverflowError,
41538 : "value too large to convert to npy_int64");
41539 : return (npy_int64) -1;
41540 : raise_neg_overflow:
41541 : PyErr_SetString(PyExc_OverflowError,
41542 : "can't convert negative value to npy_int64");
41543 : return (npy_int64) -1;
41544 : }
41545 :
41546 : /* CIntToPy */
41547 0 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_int64(npy_int64 value) {
41548 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41549 0 : #pragma GCC diagnostic push
41550 0 : #pragma GCC diagnostic ignored "-Wconversion"
41551 : #endif
41552 0 : const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 0;
41553 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41554 0 : #pragma GCC diagnostic pop
41555 : #endif
41556 0 : const int is_unsigned = neg_one > const_zero;
41557 0 : if (is_unsigned) {
41558 : if (sizeof(npy_int64) < sizeof(long)) {
41559 : return PyInt_FromLong((long) value);
41560 : } else if (sizeof(npy_int64) <= sizeof(unsigned long)) {
41561 : return PyLong_FromUnsignedLong((unsigned long) value);
41562 : #ifdef HAVE_LONG_LONG
41563 : } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
41564 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
41565 : #endif
41566 : }
41567 : } else {
41568 0 : if (sizeof(npy_int64) <= sizeof(long)) {
41569 0 : return PyInt_FromLong((long) value);
41570 : #ifdef HAVE_LONG_LONG
41571 : } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
41572 : return PyLong_FromLongLong((PY_LONG_LONG) value);
41573 : #endif
41574 : }
41575 : }
41576 : {
41577 : unsigned char *bytes = (unsigned char *)&value;
41578 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
41579 : if (is_unsigned) {
41580 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
41581 : } else {
41582 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
41583 : }
41584 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
41585 : int one = 1; int little = (int)*(unsigned char *)&one;
41586 : return _PyLong_FromByteArray(bytes, sizeof(npy_int64),
41587 : little, !is_unsigned);
41588 : #else
41589 : int one = 1; int little = (int)*(unsigned char *)&one;
41590 : PyObject *from_bytes, *result = NULL;
41591 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
41592 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
41593 : if (!from_bytes) return NULL;
41594 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_int64));
41595 : if (!py_bytes) goto limited_bad;
41596 : order_str = PyUnicode_FromString(little ? "little" : "big");
41597 : if (!order_str) goto limited_bad;
41598 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
41599 : if (!arg_tuple) goto limited_bad;
41600 : if (!is_unsigned) {
41601 : kwds = PyDict_New();
41602 : if (!kwds) goto limited_bad;
41603 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
41604 : }
41605 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
41606 : limited_bad:
41607 : Py_XDECREF(kwds);
41608 : Py_XDECREF(arg_tuple);
41609 : Py_XDECREF(order_str);
41610 : Py_XDECREF(py_bytes);
41611 : Py_XDECREF(from_bytes);
41612 : return result;
41613 : #endif
41614 : }
41615 : }
41616 :
41617 : /* ImportNumPyArray */
41618 1 : static PyObject* __Pyx__ImportNumPyArray(void) {
41619 1 : PyObject *numpy_module, *ndarray_object = NULL;
41620 1 : numpy_module = __Pyx_Import(__pyx_n_s_numpy, NULL, 0);
41621 1 : if (likely(numpy_module)) {
41622 1 : ndarray_object = PyObject_GetAttrString(numpy_module, "ndarray");
41623 1 : Py_DECREF(numpy_module);
41624 : }
41625 1 : if (unlikely(!ndarray_object)) {
41626 0 : PyErr_Clear();
41627 : }
41628 1 : if (unlikely(!ndarray_object || !PyObject_TypeCheck(ndarray_object, &PyType_Type))) {
41629 0 : Py_XDECREF(ndarray_object);
41630 0 : Py_INCREF(Py_None);
41631 : ndarray_object = Py_None;
41632 : }
41633 1 : return ndarray_object;
41634 : }
41635 55 : static CYTHON_INLINE PyObject* __Pyx_ImportNumPyArrayTypeIfAvailable(void) {
41636 55 : if (unlikely(!__pyx_numpy_ndarray)) {
41637 1 : __pyx_numpy_ndarray = __Pyx__ImportNumPyArray();
41638 : }
41639 55 : Py_INCREF(__pyx_numpy_ndarray);
41640 55 : return __pyx_numpy_ndarray;
41641 : }
41642 :
41643 : /* CIntFromPy */
41644 : static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
41645 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41646 : #pragma GCC diagnostic push
41647 : #pragma GCC diagnostic ignored "-Wconversion"
41648 : #endif
41649 : const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
41650 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41651 : #pragma GCC diagnostic pop
41652 : #endif
41653 : const int is_unsigned = neg_one > const_zero;
41654 : #if PY_MAJOR_VERSION < 3
41655 : if (likely(PyInt_Check(x))) {
41656 : if ((sizeof(size_t) < sizeof(long))) {
41657 : __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
41658 : } else {
41659 : long val = PyInt_AS_LONG(x);
41660 : if (is_unsigned && unlikely(val < 0)) {
41661 : goto raise_neg_overflow;
41662 : }
41663 : return (size_t) val;
41664 : }
41665 : }
41666 : #endif
41667 : if (unlikely(!PyLong_Check(x))) {
41668 : size_t val;
41669 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41670 : if (!tmp) return (size_t) -1;
41671 : val = __Pyx_PyInt_As_size_t(tmp);
41672 : Py_DECREF(tmp);
41673 : return val;
41674 : }
41675 : if (is_unsigned) {
41676 : #if CYTHON_USE_PYLONG_INTERNALS
41677 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
41678 : goto raise_neg_overflow;
41679 : } else if (__Pyx_PyLong_IsCompact(x)) {
41680 : __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
41681 : } else {
41682 : const digit* digits = __Pyx_PyLong_Digits(x);
41683 : assert(__Pyx_PyLong_DigitCount(x) > 1);
41684 : switch (__Pyx_PyLong_DigitCount(x)) {
41685 : case 2:
41686 : if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
41687 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41688 : __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41689 : } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) {
41690 : return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41691 : }
41692 : }
41693 : break;
41694 : case 3:
41695 : if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
41696 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41697 : __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41698 : } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) {
41699 : return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41700 : }
41701 : }
41702 : break;
41703 : case 4:
41704 : if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
41705 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41706 : __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41707 : } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) {
41708 : return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
41709 : }
41710 : }
41711 : break;
41712 : }
41713 : }
41714 : #endif
41715 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
41716 : if (unlikely(Py_SIZE(x) < 0)) {
41717 : goto raise_neg_overflow;
41718 : }
41719 : #else
41720 : {
41721 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41722 : if (unlikely(result < 0))
41723 : return (size_t) -1;
41724 : if (unlikely(result == 1))
41725 : goto raise_neg_overflow;
41726 : }
41727 : #endif
41728 : if ((sizeof(size_t) <= sizeof(unsigned long))) {
41729 : __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
41730 : #ifdef HAVE_LONG_LONG
41731 : } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
41732 : __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
41733 : #endif
41734 : }
41735 : } else {
41736 : #if CYTHON_USE_PYLONG_INTERNALS
41737 : if (__Pyx_PyLong_IsCompact(x)) {
41738 : __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
41739 : } else {
41740 : const digit* digits = __Pyx_PyLong_Digits(x);
41741 : assert(__Pyx_PyLong_DigitCount(x) > 1);
41742 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
41743 : case -2:
41744 : if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) {
41745 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41746 : __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41747 : } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
41748 : return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
41749 : }
41750 : }
41751 : break;
41752 : case 2:
41753 : if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
41754 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41755 : __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41756 : } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
41757 : return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
41758 : }
41759 : }
41760 : break;
41761 : case -3:
41762 : if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
41763 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41764 : __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41765 : } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
41766 : return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
41767 : }
41768 : }
41769 : break;
41770 : case 3:
41771 : if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
41772 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41773 : __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41774 : } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
41775 : return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
41776 : }
41777 : }
41778 : break;
41779 : case -4:
41780 : if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
41781 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41782 : __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41783 : } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
41784 : return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
41785 : }
41786 : }
41787 : break;
41788 : case 4:
41789 : if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
41790 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41791 : __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41792 : } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
41793 : return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
41794 : }
41795 : }
41796 : break;
41797 : }
41798 : }
41799 : #endif
41800 : if ((sizeof(size_t) <= sizeof(long))) {
41801 : __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
41802 : #ifdef HAVE_LONG_LONG
41803 : } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
41804 : __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
41805 : #endif
41806 : }
41807 : }
41808 : {
41809 : size_t val;
41810 : int ret = -1;
41811 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
41812 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
41813 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
41814 : if (unlikely(bytes_copied == -1)) {
41815 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
41816 : goto raise_overflow;
41817 : } else {
41818 : ret = 0;
41819 : }
41820 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
41821 : int one = 1; int is_little = (int)*(unsigned char *)&one;
41822 : unsigned char *bytes = (unsigned char *)&val;
41823 : ret = _PyLong_AsByteArray((PyLongObject *)x,
41824 : bytes, sizeof(val),
41825 : is_little, !is_unsigned);
41826 : #else
41827 : PyObject *v;
41828 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
41829 : int bits, remaining_bits, is_negative = 0;
41830 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
41831 : if (likely(PyLong_CheckExact(x))) {
41832 : v = __Pyx_NewRef(x);
41833 : } else {
41834 : v = PyNumber_Long(x);
41835 : if (unlikely(!v)) return (size_t) -1;
41836 : assert(PyLong_CheckExact(v));
41837 : }
41838 : {
41839 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
41840 : if (unlikely(result < 0)) {
41841 : Py_DECREF(v);
41842 : return (size_t) -1;
41843 : }
41844 : is_negative = result == 1;
41845 : }
41846 : if (is_unsigned && unlikely(is_negative)) {
41847 : Py_DECREF(v);
41848 : goto raise_neg_overflow;
41849 : } else if (is_negative) {
41850 : stepval = PyNumber_Invert(v);
41851 : Py_DECREF(v);
41852 : if (unlikely(!stepval))
41853 : return (size_t) -1;
41854 : } else {
41855 : stepval = v;
41856 : }
41857 : v = NULL;
41858 : val = (size_t) 0;
41859 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
41860 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
41861 : for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
41862 : PyObject *tmp, *digit;
41863 : long idigit;
41864 : digit = PyNumber_And(stepval, mask);
41865 : if (unlikely(!digit)) goto done;
41866 : idigit = PyLong_AsLong(digit);
41867 : Py_DECREF(digit);
41868 : if (unlikely(idigit < 0)) goto done;
41869 : val |= ((size_t) idigit) << bits;
41870 : tmp = PyNumber_Rshift(stepval, shift);
41871 : if (unlikely(!tmp)) goto done;
41872 : Py_DECREF(stepval); stepval = tmp;
41873 : }
41874 : Py_DECREF(shift); shift = NULL;
41875 : Py_DECREF(mask); mask = NULL;
41876 : {
41877 : long idigit = PyLong_AsLong(stepval);
41878 : if (unlikely(idigit < 0)) goto done;
41879 : remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
41880 : if (unlikely(idigit >= (1L << remaining_bits)))
41881 : goto raise_overflow;
41882 : val |= ((size_t) idigit) << bits;
41883 : }
41884 : if (!is_unsigned) {
41885 : if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
41886 : goto raise_overflow;
41887 : if (is_negative)
41888 : val = ~val;
41889 : }
41890 : ret = 0;
41891 : done:
41892 : Py_XDECREF(shift);
41893 : Py_XDECREF(mask);
41894 : Py_XDECREF(stepval);
41895 : #endif
41896 : if (unlikely(ret))
41897 : return (size_t) -1;
41898 : return val;
41899 : }
41900 : raise_overflow:
41901 : PyErr_SetString(PyExc_OverflowError,
41902 : "value too large to convert to size_t");
41903 : return (size_t) -1;
41904 : raise_neg_overflow:
41905 : PyErr_SetString(PyExc_OverflowError,
41906 : "can't convert negative value to size_t");
41907 : return (size_t) -1;
41908 : }
41909 :
41910 : /* CIntFromPy */
41911 0 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
41912 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41913 0 : #pragma GCC diagnostic push
41914 0 : #pragma GCC diagnostic ignored "-Wconversion"
41915 : #endif
41916 0 : const long neg_one = (long) -1, const_zero = (long) 0;
41917 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
41918 0 : #pragma GCC diagnostic pop
41919 : #endif
41920 0 : const int is_unsigned = neg_one > const_zero;
41921 : #if PY_MAJOR_VERSION < 3
41922 : if (likely(PyInt_Check(x))) {
41923 : if ((sizeof(long) < sizeof(long))) {
41924 : __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
41925 : } else {
41926 : long val = PyInt_AS_LONG(x);
41927 : if (is_unsigned && unlikely(val < 0)) {
41928 : goto raise_neg_overflow;
41929 : }
41930 : return (long) val;
41931 : }
41932 : }
41933 : #endif
41934 0 : if (unlikely(!PyLong_Check(x))) {
41935 0 : long val;
41936 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
41937 0 : if (!tmp) return (long) -1;
41938 0 : val = __Pyx_PyInt_As_long(tmp);
41939 0 : Py_DECREF(tmp);
41940 0 : return val;
41941 : }
41942 0 : if (is_unsigned) {
41943 : #if CYTHON_USE_PYLONG_INTERNALS
41944 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
41945 : goto raise_neg_overflow;
41946 : } else if (__Pyx_PyLong_IsCompact(x)) {
41947 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
41948 : } else {
41949 : const digit* digits = __Pyx_PyLong_Digits(x);
41950 : assert(__Pyx_PyLong_DigitCount(x) > 1);
41951 : switch (__Pyx_PyLong_DigitCount(x)) {
41952 : case 2:
41953 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
41954 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
41955 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41956 : } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
41957 : return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41958 : }
41959 : }
41960 : break;
41961 : case 3:
41962 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
41963 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
41964 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41965 : } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
41966 : return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41967 : }
41968 : }
41969 : break;
41970 : case 4:
41971 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
41972 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
41973 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
41974 : } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
41975 : return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
41976 : }
41977 : }
41978 : break;
41979 : }
41980 : }
41981 : #endif
41982 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
41983 : if (unlikely(Py_SIZE(x) < 0)) {
41984 : goto raise_neg_overflow;
41985 : }
41986 : #else
41987 : {
41988 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
41989 : if (unlikely(result < 0))
41990 : return (long) -1;
41991 : if (unlikely(result == 1))
41992 : goto raise_neg_overflow;
41993 : }
41994 : #endif
41995 : if ((sizeof(long) <= sizeof(unsigned long))) {
41996 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
41997 : #ifdef HAVE_LONG_LONG
41998 : } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
41999 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
42000 : #endif
42001 : }
42002 : } else {
42003 : #if CYTHON_USE_PYLONG_INTERNALS
42004 0 : if (__Pyx_PyLong_IsCompact(x)) {
42005 0 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
42006 : } else {
42007 0 : const digit* digits = __Pyx_PyLong_Digits(x);
42008 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
42009 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
42010 0 : case -2:
42011 0 : if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
42012 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
42013 0 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42014 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
42015 : return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42016 : }
42017 : }
42018 : break;
42019 0 : case 2:
42020 0 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
42021 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
42022 0 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42023 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
42024 : return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42025 : }
42026 : }
42027 : break;
42028 : case -3:
42029 : if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
42030 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
42031 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42032 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
42033 : return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42034 : }
42035 : }
42036 : break;
42037 : case 3:
42038 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
42039 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
42040 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42041 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
42042 : return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42043 : }
42044 : }
42045 : break;
42046 : case -4:
42047 : if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
42048 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
42049 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42050 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
42051 : return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42052 : }
42053 : }
42054 : break;
42055 : case 4:
42056 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
42057 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
42058 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42059 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
42060 : return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
42061 : }
42062 : }
42063 : break;
42064 : }
42065 : }
42066 : #endif
42067 0 : if ((sizeof(long) <= sizeof(long))) {
42068 0 : __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
42069 : #ifdef HAVE_LONG_LONG
42070 : } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
42071 : __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
42072 : #endif
42073 : }
42074 : }
42075 : {
42076 : long val;
42077 : int ret = -1;
42078 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
42079 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
42080 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
42081 : if (unlikely(bytes_copied == -1)) {
42082 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
42083 : goto raise_overflow;
42084 : } else {
42085 : ret = 0;
42086 : }
42087 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
42088 : int one = 1; int is_little = (int)*(unsigned char *)&one;
42089 : unsigned char *bytes = (unsigned char *)&val;
42090 : ret = _PyLong_AsByteArray((PyLongObject *)x,
42091 : bytes, sizeof(val),
42092 : is_little, !is_unsigned);
42093 : #else
42094 : PyObject *v;
42095 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
42096 : int bits, remaining_bits, is_negative = 0;
42097 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
42098 : if (likely(PyLong_CheckExact(x))) {
42099 : v = __Pyx_NewRef(x);
42100 : } else {
42101 : v = PyNumber_Long(x);
42102 : if (unlikely(!v)) return (long) -1;
42103 : assert(PyLong_CheckExact(v));
42104 : }
42105 : {
42106 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
42107 : if (unlikely(result < 0)) {
42108 : Py_DECREF(v);
42109 : return (long) -1;
42110 : }
42111 : is_negative = result == 1;
42112 : }
42113 : if (is_unsigned && unlikely(is_negative)) {
42114 : Py_DECREF(v);
42115 : goto raise_neg_overflow;
42116 : } else if (is_negative) {
42117 : stepval = PyNumber_Invert(v);
42118 : Py_DECREF(v);
42119 : if (unlikely(!stepval))
42120 : return (long) -1;
42121 : } else {
42122 : stepval = v;
42123 : }
42124 : v = NULL;
42125 : val = (long) 0;
42126 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
42127 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
42128 : for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
42129 : PyObject *tmp, *digit;
42130 : long idigit;
42131 : digit = PyNumber_And(stepval, mask);
42132 : if (unlikely(!digit)) goto done;
42133 : idigit = PyLong_AsLong(digit);
42134 : Py_DECREF(digit);
42135 : if (unlikely(idigit < 0)) goto done;
42136 : val |= ((long) idigit) << bits;
42137 : tmp = PyNumber_Rshift(stepval, shift);
42138 : if (unlikely(!tmp)) goto done;
42139 : Py_DECREF(stepval); stepval = tmp;
42140 : }
42141 : Py_DECREF(shift); shift = NULL;
42142 : Py_DECREF(mask); mask = NULL;
42143 : {
42144 : long idigit = PyLong_AsLong(stepval);
42145 : if (unlikely(idigit < 0)) goto done;
42146 : remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
42147 : if (unlikely(idigit >= (1L << remaining_bits)))
42148 : goto raise_overflow;
42149 : val |= ((long) idigit) << bits;
42150 : }
42151 : if (!is_unsigned) {
42152 : if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
42153 : goto raise_overflow;
42154 : if (is_negative)
42155 : val = ~val;
42156 : }
42157 : ret = 0;
42158 : done:
42159 : Py_XDECREF(shift);
42160 : Py_XDECREF(mask);
42161 : Py_XDECREF(stepval);
42162 : #endif
42163 : if (unlikely(ret))
42164 : return (long) -1;
42165 : return val;
42166 : }
42167 : raise_overflow:
42168 : PyErr_SetString(PyExc_OverflowError,
42169 : "value too large to convert to long");
42170 : return (long) -1;
42171 : raise_neg_overflow:
42172 : PyErr_SetString(PyExc_OverflowError,
42173 : "can't convert negative value to long");
42174 : return (long) -1;
42175 : }
42176 :
42177 : /* CIntFromPy */
42178 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
42179 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
42180 : #pragma GCC diagnostic push
42181 : #pragma GCC diagnostic ignored "-Wconversion"
42182 : #endif
42183 : const char neg_one = (char) -1, const_zero = (char) 0;
42184 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
42185 : #pragma GCC diagnostic pop
42186 : #endif
42187 : const int is_unsigned = neg_one > const_zero;
42188 : #if PY_MAJOR_VERSION < 3
42189 : if (likely(PyInt_Check(x))) {
42190 : if ((sizeof(char) < sizeof(long))) {
42191 : __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
42192 : } else {
42193 : long val = PyInt_AS_LONG(x);
42194 : if (is_unsigned && unlikely(val < 0)) {
42195 : goto raise_neg_overflow;
42196 : }
42197 : return (char) val;
42198 : }
42199 : }
42200 : #endif
42201 : if (unlikely(!PyLong_Check(x))) {
42202 : char val;
42203 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
42204 : if (!tmp) return (char) -1;
42205 : val = __Pyx_PyInt_As_char(tmp);
42206 : Py_DECREF(tmp);
42207 : return val;
42208 : }
42209 : if (is_unsigned) {
42210 : #if CYTHON_USE_PYLONG_INTERNALS
42211 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
42212 : goto raise_neg_overflow;
42213 : } else if (__Pyx_PyLong_IsCompact(x)) {
42214 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
42215 : } else {
42216 : const digit* digits = __Pyx_PyLong_Digits(x);
42217 : assert(__Pyx_PyLong_DigitCount(x) > 1);
42218 : switch (__Pyx_PyLong_DigitCount(x)) {
42219 : case 2:
42220 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
42221 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
42222 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42223 : } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
42224 : return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
42225 : }
42226 : }
42227 : break;
42228 : case 3:
42229 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
42230 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
42231 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42232 : } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
42233 : return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
42234 : }
42235 : }
42236 : break;
42237 : case 4:
42238 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
42239 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
42240 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42241 : } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
42242 : return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
42243 : }
42244 : }
42245 : break;
42246 : }
42247 : }
42248 : #endif
42249 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
42250 : if (unlikely(Py_SIZE(x) < 0)) {
42251 : goto raise_neg_overflow;
42252 : }
42253 : #else
42254 : {
42255 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
42256 : if (unlikely(result < 0))
42257 : return (char) -1;
42258 : if (unlikely(result == 1))
42259 : goto raise_neg_overflow;
42260 : }
42261 : #endif
42262 : if ((sizeof(char) <= sizeof(unsigned long))) {
42263 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
42264 : #ifdef HAVE_LONG_LONG
42265 : } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
42266 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
42267 : #endif
42268 : }
42269 : } else {
42270 : #if CYTHON_USE_PYLONG_INTERNALS
42271 : if (__Pyx_PyLong_IsCompact(x)) {
42272 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
42273 : } else {
42274 : const digit* digits = __Pyx_PyLong_Digits(x);
42275 : assert(__Pyx_PyLong_DigitCount(x) > 1);
42276 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
42277 : case -2:
42278 : if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
42279 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
42280 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42281 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
42282 : return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
42283 : }
42284 : }
42285 : break;
42286 : case 2:
42287 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
42288 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
42289 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42290 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
42291 : return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
42292 : }
42293 : }
42294 : break;
42295 : case -3:
42296 : if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
42297 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
42298 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42299 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
42300 : return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
42301 : }
42302 : }
42303 : break;
42304 : case 3:
42305 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
42306 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
42307 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42308 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
42309 : return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
42310 : }
42311 : }
42312 : break;
42313 : case -4:
42314 : if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
42315 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
42316 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42317 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
42318 : return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
42319 : }
42320 : }
42321 : break;
42322 : case 4:
42323 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
42324 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
42325 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
42326 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
42327 : return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
42328 : }
42329 : }
42330 : break;
42331 : }
42332 : }
42333 : #endif
42334 : if ((sizeof(char) <= sizeof(long))) {
42335 : __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
42336 : #ifdef HAVE_LONG_LONG
42337 : } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
42338 : __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
42339 : #endif
42340 : }
42341 : }
42342 : {
42343 : char val;
42344 : int ret = -1;
42345 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
42346 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
42347 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
42348 : if (unlikely(bytes_copied == -1)) {
42349 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
42350 : goto raise_overflow;
42351 : } else {
42352 : ret = 0;
42353 : }
42354 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
42355 : int one = 1; int is_little = (int)*(unsigned char *)&one;
42356 : unsigned char *bytes = (unsigned char *)&val;
42357 : ret = _PyLong_AsByteArray((PyLongObject *)x,
42358 : bytes, sizeof(val),
42359 : is_little, !is_unsigned);
42360 : #else
42361 : PyObject *v;
42362 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
42363 : int bits, remaining_bits, is_negative = 0;
42364 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
42365 : if (likely(PyLong_CheckExact(x))) {
42366 : v = __Pyx_NewRef(x);
42367 : } else {
42368 : v = PyNumber_Long(x);
42369 : if (unlikely(!v)) return (char) -1;
42370 : assert(PyLong_CheckExact(v));
42371 : }
42372 : {
42373 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
42374 : if (unlikely(result < 0)) {
42375 : Py_DECREF(v);
42376 : return (char) -1;
42377 : }
42378 : is_negative = result == 1;
42379 : }
42380 : if (is_unsigned && unlikely(is_negative)) {
42381 : Py_DECREF(v);
42382 : goto raise_neg_overflow;
42383 : } else if (is_negative) {
42384 : stepval = PyNumber_Invert(v);
42385 : Py_DECREF(v);
42386 : if (unlikely(!stepval))
42387 : return (char) -1;
42388 : } else {
42389 : stepval = v;
42390 : }
42391 : v = NULL;
42392 : val = (char) 0;
42393 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
42394 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
42395 : for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
42396 : PyObject *tmp, *digit;
42397 : long idigit;
42398 : digit = PyNumber_And(stepval, mask);
42399 : if (unlikely(!digit)) goto done;
42400 : idigit = PyLong_AsLong(digit);
42401 : Py_DECREF(digit);
42402 : if (unlikely(idigit < 0)) goto done;
42403 : val |= ((char) idigit) << bits;
42404 : tmp = PyNumber_Rshift(stepval, shift);
42405 : if (unlikely(!tmp)) goto done;
42406 : Py_DECREF(stepval); stepval = tmp;
42407 : }
42408 : Py_DECREF(shift); shift = NULL;
42409 : Py_DECREF(mask); mask = NULL;
42410 : {
42411 : long idigit = PyLong_AsLong(stepval);
42412 : if (unlikely(idigit < 0)) goto done;
42413 : remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
42414 : if (unlikely(idigit >= (1L << remaining_bits)))
42415 : goto raise_overflow;
42416 : val |= ((char) idigit) << bits;
42417 : }
42418 : if (!is_unsigned) {
42419 : if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
42420 : goto raise_overflow;
42421 : if (is_negative)
42422 : val = ~val;
42423 : }
42424 : ret = 0;
42425 : done:
42426 : Py_XDECREF(shift);
42427 : Py_XDECREF(mask);
42428 : Py_XDECREF(stepval);
42429 : #endif
42430 : if (unlikely(ret))
42431 : return (char) -1;
42432 : return val;
42433 : }
42434 : raise_overflow:
42435 : PyErr_SetString(PyExc_OverflowError,
42436 : "value too large to convert to char");
42437 : return (char) -1;
42438 : raise_neg_overflow:
42439 : PyErr_SetString(PyExc_OverflowError,
42440 : "can't convert negative value to char");
42441 : return (char) -1;
42442 : }
42443 :
42444 : /* FormatTypeName */
42445 : #if CYTHON_COMPILING_IN_LIMITED_API
42446 : static __Pyx_TypeName
42447 : __Pyx_PyType_GetName(PyTypeObject* tp)
42448 : {
42449 : PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
42450 : __pyx_n_s_name_2);
42451 : if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
42452 : PyErr_Clear();
42453 : Py_XDECREF(name);
42454 : name = __Pyx_NewRef(__pyx_n_s__52);
42455 : }
42456 : return name;
42457 : }
42458 : #endif
42459 :
42460 : /* CheckBinaryVersion */
42461 3 : static unsigned long __Pyx_get_runtime_version(void) {
42462 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
42463 3 : return Py_Version & ~0xFFUL;
42464 : #else
42465 : const char* rt_version = Py_GetVersion();
42466 : unsigned long version = 0;
42467 : unsigned long factor = 0x01000000UL;
42468 : unsigned int digit = 0;
42469 : int i = 0;
42470 : while (factor) {
42471 : while ('0' <= rt_version[i] && rt_version[i] <= '9') {
42472 : digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
42473 : ++i;
42474 : }
42475 : version += factor * digit;
42476 : if (rt_version[i] != '.')
42477 : break;
42478 : digit = 0;
42479 : factor >>= 8;
42480 : ++i;
42481 : }
42482 : return version;
42483 : #endif
42484 : }
42485 3 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
42486 3 : const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
42487 3 : if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
42488 : return 0;
42489 0 : if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
42490 : return 1;
42491 0 : {
42492 0 : char message[200];
42493 0 : PyOS_snprintf(message, sizeof(message),
42494 : "compile time Python version %d.%d "
42495 : "of module '%.100s' "
42496 : "%s "
42497 : "runtime version %d.%d",
42498 0 : (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
42499 : __Pyx_MODULE_NAME,
42500 : (allow_newer) ? "was newer than" : "does not match",
42501 0 : (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
42502 : );
42503 0 : return PyErr_WarnEx(NULL, message, 1);
42504 : }
42505 : }
42506 :
42507 : /* InitStrings */
42508 : #if PY_MAJOR_VERSION >= 3
42509 780 : static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
42510 780 : if (t.is_unicode | t.is_str) {
42511 777 : if (t.intern) {
42512 561 : *str = PyUnicode_InternFromString(t.s);
42513 216 : } else if (t.encoding) {
42514 0 : *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
42515 : } else {
42516 216 : *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
42517 : }
42518 : } else {
42519 3 : *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
42520 : }
42521 780 : if (!*str)
42522 : return -1;
42523 780 : if (PyObject_Hash(*str) == -1)
42524 : return -1;
42525 : return 0;
42526 : }
42527 : #endif
42528 3 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
42529 783 : while (t->p) {
42530 : #if PY_MAJOR_VERSION >= 3
42531 780 : __Pyx_InitString(*t, t->p);
42532 : #else
42533 : if (t->is_unicode) {
42534 : *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
42535 : } else if (t->intern) {
42536 : *t->p = PyString_InternFromString(t->s);
42537 : } else {
42538 : *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
42539 : }
42540 : if (!*t->p)
42541 : return -1;
42542 : if (PyObject_Hash(*t->p) == -1)
42543 : return -1;
42544 : #endif
42545 780 : ++t;
42546 : }
42547 3 : return 0;
42548 : }
42549 :
42550 : #include <string.h>
42551 0 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
42552 0 : size_t len = strlen(s);
42553 0 : if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
42554 : PyErr_SetString(PyExc_OverflowError, "byte string is too long");
42555 : return -1;
42556 : }
42557 : return (Py_ssize_t) len;
42558 : }
42559 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
42560 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
42561 : if (unlikely(len < 0)) return NULL;
42562 : return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
42563 : }
42564 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
42565 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
42566 : if (unlikely(len < 0)) return NULL;
42567 : return PyByteArray_FromStringAndSize(c_str, len);
42568 : }
42569 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
42570 : Py_ssize_t ignore;
42571 : return __Pyx_PyObject_AsStringAndSize(o, &ignore);
42572 : }
42573 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
42574 : #if !CYTHON_PEP393_ENABLED
42575 : static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42576 : char* defenc_c;
42577 : PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
42578 : if (!defenc) return NULL;
42579 : defenc_c = PyBytes_AS_STRING(defenc);
42580 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42581 : {
42582 : char* end = defenc_c + PyBytes_GET_SIZE(defenc);
42583 : char* c;
42584 : for (c = defenc_c; c < end; c++) {
42585 : if ((unsigned char) (*c) >= 128) {
42586 : PyUnicode_AsASCIIString(o);
42587 : return NULL;
42588 : }
42589 : }
42590 : }
42591 : #endif
42592 : *length = PyBytes_GET_SIZE(defenc);
42593 : return defenc_c;
42594 : }
42595 : #else
42596 : static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42597 : if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
42598 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42599 : if (likely(PyUnicode_IS_ASCII(o))) {
42600 : *length = PyUnicode_GET_LENGTH(o);
42601 : return PyUnicode_AsUTF8(o);
42602 : } else {
42603 : PyUnicode_AsASCIIString(o);
42604 : return NULL;
42605 : }
42606 : #else
42607 : return PyUnicode_AsUTF8AndSize(o, length);
42608 : #endif
42609 : }
42610 : #endif
42611 : #endif
42612 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
42613 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
42614 : if (
42615 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
42616 : __Pyx_sys_getdefaultencoding_not_ascii &&
42617 : #endif
42618 : PyUnicode_Check(o)) {
42619 : return __Pyx_PyUnicode_AsStringAndSize(o, length);
42620 : } else
42621 : #endif
42622 : #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
42623 : if (PyByteArray_Check(o)) {
42624 : *length = PyByteArray_GET_SIZE(o);
42625 : return PyByteArray_AS_STRING(o);
42626 : } else
42627 : #endif
42628 : {
42629 : char* result;
42630 : int r = PyBytes_AsStringAndSize(o, &result, length);
42631 : if (unlikely(r < 0)) {
42632 : return NULL;
42633 : } else {
42634 : return result;
42635 : }
42636 : }
42637 : }
42638 91800 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
42639 91800 : int is_true = x == Py_True;
42640 91800 : if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
42641 2892 : else return PyObject_IsTrue(x);
42642 : }
42643 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
42644 : int retval;
42645 : if (unlikely(!x)) return -1;
42646 : retval = __Pyx_PyObject_IsTrue(x);
42647 : Py_DECREF(x);
42648 : return retval;
42649 : }
42650 0 : static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
42651 0 : __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
42652 : #if PY_MAJOR_VERSION >= 3
42653 0 : if (PyLong_Check(result)) {
42654 0 : if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
42655 : "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
42656 : "The ability to return an instance of a strict subclass of int is deprecated, "
42657 : "and may be removed in a future version of Python.",
42658 : result_type_name)) {
42659 0 : __Pyx_DECREF_TypeName(result_type_name);
42660 0 : Py_DECREF(result);
42661 0 : return NULL;
42662 : }
42663 : __Pyx_DECREF_TypeName(result_type_name);
42664 : return result;
42665 : }
42666 : #endif
42667 0 : PyErr_Format(PyExc_TypeError,
42668 : "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
42669 : type_name, type_name, result_type_name);
42670 0 : __Pyx_DECREF_TypeName(result_type_name);
42671 0 : Py_DECREF(result);
42672 : return NULL;
42673 : }
42674 159 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
42675 : #if CYTHON_USE_TYPE_SLOTS
42676 159 : PyNumberMethods *m;
42677 : #endif
42678 159 : const char *name = NULL;
42679 159 : PyObject *res = NULL;
42680 : #if PY_MAJOR_VERSION < 3
42681 : if (likely(PyInt_Check(x) || PyLong_Check(x)))
42682 : #else
42683 159 : if (likely(PyLong_Check(x)))
42684 : #endif
42685 0 : return __Pyx_NewRef(x);
42686 : #if CYTHON_USE_TYPE_SLOTS
42687 159 : m = Py_TYPE(x)->tp_as_number;
42688 : #if PY_MAJOR_VERSION < 3
42689 : if (m && m->nb_int) {
42690 : name = "int";
42691 : res = m->nb_int(x);
42692 : }
42693 : else if (m && m->nb_long) {
42694 : name = "long";
42695 : res = m->nb_long(x);
42696 : }
42697 : #else
42698 159 : if (likely(m && m->nb_int)) {
42699 159 : name = "int";
42700 159 : res = m->nb_int(x);
42701 : }
42702 : #endif
42703 : #else
42704 : if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
42705 : res = PyNumber_Int(x);
42706 : }
42707 : #endif
42708 159 : if (likely(res)) {
42709 : #if PY_MAJOR_VERSION < 3
42710 : if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
42711 : #else
42712 159 : if (unlikely(!PyLong_CheckExact(res))) {
42713 : #endif
42714 0 : return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
42715 : }
42716 : }
42717 0 : else if (!PyErr_Occurred()) {
42718 0 : PyErr_SetString(PyExc_TypeError,
42719 : "an integer is required");
42720 : }
42721 : return res;
42722 : }
42723 6550 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
42724 6550 : Py_ssize_t ival;
42725 6550 : PyObject *x;
42726 : #if PY_MAJOR_VERSION < 3
42727 : if (likely(PyInt_CheckExact(b))) {
42728 : if (sizeof(Py_ssize_t) >= sizeof(long))
42729 : return PyInt_AS_LONG(b);
42730 : else
42731 : return PyInt_AsSsize_t(b);
42732 : }
42733 : #endif
42734 6550 : if (likely(PyLong_CheckExact(b))) {
42735 : #if CYTHON_USE_PYLONG_INTERNALS
42736 6550 : if (likely(__Pyx_PyLong_IsCompact(b))) {
42737 6550 : return __Pyx_PyLong_CompactValue(b);
42738 : } else {
42739 0 : const digit* digits = __Pyx_PyLong_Digits(b);
42740 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
42741 0 : switch (size) {
42742 0 : case 2:
42743 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
42744 0 : return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42745 : }
42746 : break;
42747 0 : case -2:
42748 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
42749 0 : return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42750 : }
42751 : break;
42752 : case 3:
42753 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
42754 : return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42755 : }
42756 : break;
42757 : case -3:
42758 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
42759 : return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42760 : }
42761 : break;
42762 : case 4:
42763 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
42764 : return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42765 : }
42766 : break;
42767 : case -4:
42768 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
42769 : return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
42770 : }
42771 : break;
42772 : }
42773 : }
42774 : #endif
42775 0 : return PyLong_AsSsize_t(b);
42776 : }
42777 0 : x = PyNumber_Index(b);
42778 0 : if (!x) return -1;
42779 0 : ival = PyInt_AsSsize_t(x);
42780 0 : Py_DECREF(x);
42781 : return ival;
42782 : }
42783 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
42784 : if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
42785 : return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
42786 : #if PY_MAJOR_VERSION < 3
42787 : } else if (likely(PyInt_CheckExact(o))) {
42788 : return PyInt_AS_LONG(o);
42789 : #endif
42790 : } else {
42791 : Py_ssize_t ival;
42792 : PyObject *x;
42793 : x = PyNumber_Index(o);
42794 : if (!x) return -1;
42795 : ival = PyInt_AsLong(x);
42796 : Py_DECREF(x);
42797 : return ival;
42798 : }
42799 : }
42800 78202 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
42801 78202 : return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
42802 : }
42803 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
42804 : return PyInt_FromSize_t(ival);
42805 : }
42806 :
42807 :
42808 : /* #### Code section: utility_code_pragmas_end ### */
42809 : #ifdef _MSC_VER
42810 : #pragma warning( pop )
42811 : #endif
42812 :
42813 :
42814 :
42815 : /* #### Code section: end ### */
42816 : #endif /* Py_PYTHON_H */
|